]> granicus.if.org Git - php/commitdiff
- Fixed bug #62064 (memory leak in the XML Writer module)
authorFelipe Pena <felipensp@gmail.com>
Fri, 18 May 2012 22:23:29 +0000 (19:23 -0300)
committerFelipe Pena <felipensp@gmail.com>
Fri, 18 May 2012 22:23:29 +0000 (19:23 -0300)
ext/xmlwriter/php_xmlwriter.c

index 4ea76dad51ec747c10dd22eb6053095067dc9223..588ca4bf3a1e9acd191b10d30ee556e4f89215f1 100644 (file)
@@ -616,6 +616,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;
@@ -626,6 +627,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;
                        }