Commit 765f062a authored by Nikias Bassen's avatar Nikias Bassen

xplist: Prevent memory leak(s) when parsing fails

Credit to OSS-Fuzz
parent 012e4a8d
...@@ -1221,7 +1221,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist) ...@@ -1221,7 +1221,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist)
if (!keyname) { if (!keyname) {
PLIST_XML_ERR("missing key name while adding dict item\n"); PLIST_XML_ERR("missing key name while adding dict item\n");
ctx->err++; ctx->err++;
break; goto err_out;
} }
plist_dict_set_item(parent, keyname, subnode); plist_dict_set_item(parent, keyname, subnode);
break; break;
...@@ -1232,7 +1232,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist) ...@@ -1232,7 +1232,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist)
/* should not happen */ /* should not happen */
PLIST_XML_ERR("parent is not a structered node\n"); PLIST_XML_ERR("parent is not a structered node\n");
ctx->err++; ctx->err++;
break; goto err_out;
} }
} }
if (!is_empty && (data->type == PLIST_DICT || data->type == PLIST_ARRAY)) { if (!is_empty && (data->type == PLIST_DICT || data->type == PLIST_ARRAY)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment