summaryrefslogtreecommitdiff
path: root/ext/standard/url_scanner_ex.re
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2001-01-09 16:45:19 +0000
committerSascha Schumann <sas@php.net>2001-01-09 16:45:19 +0000
commit7eb8469679bf44b200c6f55ac59cb8592b9638f4 (patch)
treeae1e44b1a574a18a68ee7ef389526f4eb1bc46fe /ext/standard/url_scanner_ex.re
parent8d5d20500bad80f4a5a28d1c4e8796672b2c9c19 (diff)
downloadphp-git-7eb8469679bf44b200c6f55ac59cb8592b9638f4.tar.gz
Avoid possible memory leak in the URL scanner, if the connection is
interrupted during writing the output.
Diffstat (limited to 'ext/standard/url_scanner_ex.re')
-rw-r--r--ext/standard/url_scanner_ex.re7
1 files changed, 1 insertions, 6 deletions
diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re
index 3060658097..3eb7a56c08 100644
--- a/ext/standard/url_scanner_ex.re
+++ b/ext/standard/url_scanner_ex.re
@@ -334,14 +334,9 @@ char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char
mainloop(ctx, src, srclen);
*newlen = ctx->result.len;
- if (ctx->result.len == 0) {
- return strdup("");
- }
smart_str_0(&ctx->result);
- ret = malloc(ctx->result.len + 1);
- memcpy(ret, ctx->result.c, ctx->result.len + 1);
ctx->result.len = 0;
- return ret;
+ return ctx->result.c;
}
PHP_RINIT_FUNCTION(url_scanner)