_emalloc bug?

From: Date: Fri, 27 Jul 2001 12:26:45 +0000
Subject: _emalloc bug?
Groups: php.dev 
Request: Send a blank email to php-dev+get-61200@lists.php.net to get a copy of this message
-- php-4.0.6/Zend/zend_alloc.c (160) ------------------------------- if (!p) { fprintf(stderr,"FATAL: emalloc(): Unable to allocate %ld bytes\n", (long) size); #if ZEND_DEBUG && defined(HAVE_KILL) && defined(HAVE_GETPID) kill(getpid(), SIGSEGV); #else exit(1); #endif HANDLE_UNBLOCK_INTERRUPTIONS(); return (void *)p; } -------------------------------------------------------------------- If p==NULL _emalloc does not return, so checking the return value is pointless because you can do this iff it's ok. Maybe I'missing something :-) A minor problem exists with size: size_t should be unsigned and the type modifier assumes it's signed. Ciao. -- Walter Franzini, e-mail: walter@sys-net.it SysNet, Via Digione 8, 27100 Pavia - Italy

« previous php.dev (#61200) next »