1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

malloc-fail: Fix another memory leak in xmlSchemaBucketCreate

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer 2023-03-05 14:10:26 +01:00
parent 31844c74df
commit 260d6b8d77

View File

@ -3755,7 +3755,10 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
return(NULL);
}
}
xmlSchemaItemListAdd(mainSchema->includes, ret);
if (xmlSchemaItemListAdd(mainSchema->includes, ret) < 0) {
xmlSchemaBucketFree(ret);
return(NULL);
}
}
/*
* Add to list of all buckets; this is used for lookup