diff options
author | Wez Furlong <wez@php.net> | 2002-08-16 12:02:42 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-08-16 12:02:42 +0000 |
commit | 2e4b6ef181934b893001723f3cbec091d23e9bbd (patch) | |
tree | eb32a1c967ae22d07ead106147e9fcbedf3a5f32 | |
parent | 5a41ced0d76ccb6623d929e4d48f00c9f144cd66 (diff) | |
download | php-git-2e4b6ef181934b893001723f3cbec091d23e9bbd.tar.gz |
Fix a little leak.
-rwxr-xr-x | main/streams.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 */ |