Skip to content

Commit d319083

Browse files
mattrajcaianpartridge
authored andcommitted
Fix memory leaks by using more specialized xml*Free functions.
Fixes https://bugs.swift.org/browse/SR-5256.
1 parent 3a2d346 commit d319083

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CoreFoundation/Parsing.subproj/CFXMLInterface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,8 @@ CFArrayRef _CFXMLNodesForXPath(_CFXMLNodePtr node, const unsigned char* xpath) {
893893
CFArrayAppendValue(results, nodes->nodeTab[i]);
894894
}
895895

896-
xmlFree(context);
897-
xmlFree(evalResult);
896+
xmlXPathFreeContext(context);
897+
xmlXPathFreeObject(evalResult);
898898

899899
return results;
900900
}

0 commit comments

Comments
 (0)