From: Wez Furlong Date: Tue, 20 Aug 2002 22:08:55 +0000 (+0000) Subject: Fix newly introduced leak in the debug build. X-Git-Tag: RELEASE_0_91~367 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03b8214b9d93523b3a242cd3ddbfda2a4308f808;p=php Fix newly introduced leak in the debug build. --- diff --git a/main/streams.c b/main/streams.c index 0cfe5d38b3..c760b9bf33 100755 --- a/main/streams.c +++ b/main/streams.c @@ -163,15 +163,21 @@ fprintf(stderr, "stream_free: %s:%p in_free=%d opts=%08x\n", stream->ops->label, * of stream it was. */ char leakbuf[512]; snprintf(leakbuf, sizeof(leakbuf), __FILE__ "(%d) : Stream of type '%s' 0x%08X (path:%s) was not closed\n", __LINE__, stream->ops->label, (unsigned int)stream, stream->__orig_path); + + STR_FREE(stream->__orig_path); + # if defined(PHP_WIN32) OutputDebugString(leakbuf); # else fprintf(stderr, leakbuf); # endif + } else { + STR_FREE(stream->__orig_path); + pefree(stream, stream->is_persistent); } - else -#endif +#else pefree(stream, stream->is_persistent); +#endif } return ret;