Re: cvs: php4 /main safe_mode.c

From: Date: Fri, 16 Aug 2002 12:29:36 +0000
Subject: Re: cvs: php4 /main safe_mode.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13411@lists.php.net to get a copy of this message
But that code does not allocate a value for msg; it's either a constant or the contents of a static buffer. --Wez. On 08/16/02, "Ilia A." <ilia@prohost.org> wrote: > The fix you've commited or the patch that I've sent you via email fixes that > leak. There is another potential leak (not freed msg) inside > _php_stream_opendir. > > The patch below fixes that problem. > > --- main/streams.c_old Fri Aug 16 08:19:05 2002 > +++ main/streams.c Fri Aug 16 08:37:12 2002 > @@ -1267,7 +1267,7 @@ > > if (stream == NULL && (options & REPORT_ERRORS)) { > char *tmp = estrdup(path); > - char *msg; > + char *msg = NULL; > > if (wrapper) > msg = strerror(errno); > @@ -1277,6 +1277,7 @@ > php_strip_url_passwd(tmp); > zend_error(E_WARNING, "%s(\"%s\") - %s", > get_active_function_name(TSRMLS_C), tmp, msg); > efree(tmp); > + if( msg ) efree(msg); > } > return stream; > } > > > Ilia

« previous php.cvs (#13411) next »