1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-31 06:50:06 +03:00

malloc-fail: Fix leak of xmlCharEncodingHandler

Also free handler if its name is NULL.

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer 2023-02-14 13:50:46 +01:00
parent f8852184a1
commit d18f9c1102

View File

@ -2822,7 +2822,6 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
int i = 0;
if (handler == NULL) return(-1);
if (handler->name == NULL) return(-1);
for (i = 0; i < (int) NUM_DEFAULT_HANDLERS; i++) {
if (handler == &defaultHandlers[i])