Patch xmlwriter_open_uri_leaks for XML Writer Bug #62064
Patch version 2012-05-18 19:30 UTC
Return to Bug #62064 |
Download this patch
Patch Revisions:
Developer: jean-pierre.lozi@lip6.fr
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index 84be01d..0514b17 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -614,6 +614,7 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i
/* absolute file uris - libxml only supports localhost or empty host */
if (strncasecmp(source, "file:///", 8) == 0) {
if (source[sizeof("file:///") - 1] == '\0') {
+ xmlFreeURI(uri);
return NULL;
}
isFileUri = 1;
@@ -624,6 +625,7 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i
#endif
} else if (strncasecmp(source, "file://localhost/",17) == 0) {
if (source[sizeof("file://localhost/") - 1] == '\0') {
+ xmlFreeURI(uri);
return NULL;
}
|