summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-01-03 17:12:35 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-01-03 17:12:35 +0000
commit71ab7dfccca65d28fd946cb6988b8e52d48461b8 (patch)
tree35f275c4bd9828a4581253cf963942da1e93a820
parentc52cdad25a7ac680fba05fa68b552a15e484f88e (diff)
downloadphp-git-71ab7dfccca65d28fd946cb6988b8e52d48461b8.tar.gz
Fixed a memory leak that occurs if the location specified by redirect header
cannot be opened.
-rw-r--r--ext/standard/http_fopen_wrapper.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index c3f10fd3e9..4ae41fb93c 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -311,9 +311,9 @@ php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, ch
php_stream_notify_file_size(context, file_size, http_header_line, 0);
}
- if (http_header_line[0] == '\0')
+ if (http_header_line[0] == '\0') {
body = 1;
- else {
+ } else {
zval *http_header;
MAKE_STD_ZVAL(http_header);
@@ -322,9 +322,9 @@ php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, ch
zend_hash_next_index_insert(Z_ARRVAL_P(response_header), &http_header, sizeof(zval *), NULL);
}
- }
- else
+ } else {
break;
+ }
}
}
@@ -379,9 +379,11 @@ php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, ch
}
zval_dtor(stream->wrapperdata);
FREE_ZVAL(stream->wrapperdata);
+ } else {
+ zval_dtor(response_header);
+ FREE_ZVAL(response_header);
}
} else {
-
zval_dtor(response_header);
FREE_ZVAL(response_header);