diff options
| author | 2017-03-29 22:08:21 +0200 | |
|---|---|---|
| committer | 2017-03-29 22:08:21 +0200 | |
| commit | 765f062a4563901ecf9881ac541fc248aa30d44d (patch) | |
| tree | 01532b7f4049d093a51458fe37a6ac5c6c22b672 /src/xplist.c | |
| parent | 012e4a8d7c99baf326cbcf06eabe899e2cdf66f7 (diff) | |
| download | libplist-765f062a4563901ecf9881ac541fc248aa30d44d.tar.gz libplist-765f062a4563901ecf9881ac541fc248aa30d44d.tar.bz2 | |
xplist: Prevent memory leak(s) when parsing fails
Credit to OSS-Fuzz
Diffstat (limited to 'src/xplist.c')
| -rw-r--r-- | src/xplist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xplist.c b/src/xplist.c index 022f1cd..f896030 100644 --- a/src/xplist.c +++ b/src/xplist.c | |||
| @@ -1221,7 +1221,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist) | |||
| 1221 | if (!keyname) { | 1221 | if (!keyname) { |
| 1222 | PLIST_XML_ERR("missing key name while adding dict item\n"); | 1222 | PLIST_XML_ERR("missing key name while adding dict item\n"); |
| 1223 | ctx->err++; | 1223 | ctx->err++; |
| 1224 | break; | 1224 | goto err_out; |
| 1225 | } | 1225 | } |
| 1226 | plist_dict_set_item(parent, keyname, subnode); | 1226 | plist_dict_set_item(parent, keyname, subnode); |
| 1227 | break; | 1227 | break; |
| @@ -1232,7 +1232,7 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist) | |||
| 1232 | /* should not happen */ | 1232 | /* should not happen */ |
| 1233 | PLIST_XML_ERR("parent is not a structered node\n"); | 1233 | PLIST_XML_ERR("parent is not a structered node\n"); |
| 1234 | ctx->err++; | 1234 | ctx->err++; |
| 1235 | break; | 1235 | goto err_out; |
| 1236 | } | 1236 | } |
| 1237 | } | 1237 | } |
| 1238 | if (!is_empty && (data->type == PLIST_DICT || data->type == PLIST_ARRAY)) { | 1238 | if (!is_empty && (data->type == PLIST_DICT || data->type == PLIST_ARRAY)) { |
