From 2e4b6ef181934b893001723f3cbec091d23e9bbd Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 16 Aug 2002 12:02:42 +0000 Subject: [PATCH] Fix a little leak. --- main/streams.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/streams.c b/main/streams.c index f6e6229fba..3b05145043 100755 --- a/main/streams.c +++ b/main/streams.c @@ -1366,6 +1366,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio 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 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio strcat(msg, br); } + free_msg = 1; } else { msg = strerror(errno); } @@ -1405,6 +1407,8 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio 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 */ -- 2.50.1