diff options
| author | 2022-01-31 23:53:50 +0100 | |
|---|---|---|
| committer | 2022-01-31 23:53:50 +0100 | |
| commit | db4635a081b03eb9a2ea310bfb2f994fd9d4ee94 (patch) | |
| tree | 272814b02879f2fd18df540b461ff1f3034c2df5 /src | |
| parent | 6fcecd0226ee25e69ce049c4eba10933a0a2e944 (diff) | |
| download | libplist-db4635a081b03eb9a2ea310bfb2f994fd9d4ee94.tar.gz libplist-db4635a081b03eb9a2ea310bfb2f994fd9d4ee94.tar.bz2 | |
jplist: Fix memory leak that occurs when JSON parsing fails
Credit to OSS-Fuzz
Diffstat (limited to 'src')
| -rw-r--r-- | src/jplist.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/jplist.c b/src/jplist.c index 827b367..65eb528 100644 --- a/src/jplist.c +++ b/src/jplist.c | |||
| @@ -663,6 +663,7 @@ static plist_t parse_object(const char* js, jsmntok_info_t* ti, int* index) | |||
| 663 | if (val) { | 663 | if (val) { |
| 664 | plist_dict_set_item(obj, key, val); | 664 | plist_dict_set_item(obj, key, val); |
| 665 | } else { | 665 | } else { |
| 666 | free(key); | ||
| 666 | plist_free(obj); | 667 | plist_free(obj); |
| 667 | return NULL; | 668 | return NULL; |
| 668 | } | 669 | } |
