cvs: php4 /main streams.c

From: Date: Fri, 16 Aug 2002 12:02:43 +0000
Subject: cvs: php4 /main streams.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13406@lists.php.net to get a copy of this message
wez Fri Aug 16 08:02:43 2002 EDT Modified files: /php4/main streams.c Log: Fix a little leak. Index: php4/main/streams.c diff -u php4/main/streams.c:1.61 php4/main/streams.c:1.62 --- php4/main/streams.c:1.61 Fri Aug 16 05:50:24 2002 +++ php4/main/streams.c Fri Aug 16 08:02:42 2002 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streams.c,v 1.61 2002/08/16 09:50:24 wez Exp $ */ +/* $Id: streams.c,v 1.62 2002/08/16 12:02:42 wez Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -1366,6 +1366,7 @@ if (stream == NULL && (options & REPORT_ERRORS)) { char *tmp = estrdup(path); char *msg; + int free_msg = 0; if (wrapper) { if (wrapper->err_count) { @@ -1395,6 +1396,7 @@ strcat(msg, br); } + free_msg = 1; } else { msg = strerror(errno); } @@ -1405,6 +1407,8 @@ php_strip_url_passwd(tmp); php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "failed to create stream: %s", msg); efree(tmp); + if (free_msg) + efree(msg); } if (wrapper) { /* tidy up the error stack */

« previous php.cvs (#13406) next »