]> 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:34:39 +0000 (19:34 -0300)
committerFelipe Pena <felipensp@gmail.com>
Fri, 18 May 2012 22:34:39 +0000 (19:34 -0300)
ext/xmlwriter/php_xmlwriter.c

index 84be01d70aedce53a172aad3ce3a595a4e4e2096..0514b17ff6e9b1f6c2b3dc419c82efea23dd5216 100644 (file)
@@ -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;
                        }