Not reviewed, trivial leak fix.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Nov 2007 12:27:06 +0000 (12:27 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Nov 2007 12:27:06 +0000 (12:27 +0000)
        Fix xsltUnicodeSortFunction() memory leaks.

        * xml/XSLTUnicodeSort.cpp:
        (WebCore::xsltUnicodeSortFunction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27987 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/xml/XSLTUnicodeSort.cpp

index 52dde1e..5639db4 100644 (file)
@@ -1,5 +1,14 @@
 2007-11-23  Alexey Proskuryakov  <ap@webkit.org>
 
+        Not reviewed, trivial leak fix.
+
+        Fix xsltUnicodeSortFunction() memory leaks.
+
+        * xml/XSLTUnicodeSort.cpp:
+        (WebCore::xsltUnicodeSortFunction):
+
+2007-11-23  Alexey Proskuryakov  <ap@webkit.org>
+
         Reviewed by Maciej.
 
         <rdar://problem/5539306> REGRESSION: redirect fails when subframe's document is opened but
index 139eab4..1ffc18e 100644 (file)
@@ -257,6 +257,8 @@ void xsltUnicodeSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, in
                         targetlen = ucnv_toUChars(conv, target, targetlen, (const char*)results[j]->stringval, -1, &status);
                         target2len = ucnv_toUChars(conv, target2, target2len, (const char*)results[j+incr]->stringval, -1, &status);
                         tst = ucol_strcoll(coll, target, u_strlen(target), target2, u_strlen(target2));
+                        xmlFree(target);
+                        xmlFree(target2);
                         /* End ICU change */
                     }
                     if (descending)
@@ -318,6 +320,8 @@ void xsltUnicodeSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, in
                                 targetlen = ucnv_toUChars(conv, target, targetlen, (const char*)res[j]->stringval, -1, &status);
                                 target2len = ucnv_toUChars(conv, target2, target2len, (const char*)res[j+incr]->stringval, -1, &status);
                                 tst = ucol_strcoll(coll, target, u_strlen(target), target2, u_strlen(target2));
+                                xmlFree(target);
+                                xmlFree(target2);
                                 /* End ICU change */
                             }
                             if (desc)