diff options
author | Jonathan Beck | 2009-02-14 18:49:17 +0100 |
---|---|---|
committer | Jonathan Beck | 2009-02-14 18:49:17 +0100 |
commit | 3c458d22fdad10b41d810248c6a8efbe5b23f515 (patch) | |
tree | e9c469fa2ada4d9df4023e866eff6a3858d18f62 /src/bplist.c | |
parent | aa3a4c8d45be9da585d1aae141a546cfbbdf509f (diff) | |
download | libplist-3c458d22fdad10b41d810248c6a8efbe5b23f515.tar.gz libplist-3c458d22fdad10b41d810248c6a8efbe5b23f515.tar.bz2 |
Fix more memory leaks.
Diffstat (limited to 'src/bplist.c')
-rw-r--r-- | src/bplist.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bplist.c b/src/bplist.c index d848e6a..95070d7 100644 --- a/src/bplist.c +++ b/src/bplist.c @@ -285,6 +285,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec if (plist_get_node_type(size_node) != PLIST_UINT) return NULL; plist_get_uint_val(size_node, &size); + plist_free(size_node); } return parse_data_node(object, size); @@ -294,6 +295,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec if (plist_get_node_type(size_node) != PLIST_UINT) return NULL; plist_get_uint_val(size_node, &size); + plist_free(size_node); } return parse_string_node(object, size); @@ -303,6 +305,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec if (plist_get_node_type(size_node) != PLIST_UINT) return NULL; plist_get_uint_val(size_node, &size); + plist_free(size_node); } return parse_unicode_node(object, size); @@ -313,6 +316,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec if (plist_get_node_type(size_node) != PLIST_UINT) return NULL; plist_get_uint_val(size_node, &size); + plist_free(size_node); } return parse_array_node(object, size, dict_size); @@ -323,6 +327,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec if (plist_get_node_type(size_node) != PLIST_UINT) return NULL; plist_get_uint_val(size_node, &size); + plist_free(size_node); } return parse_dict_node(object, size, dict_size); default: @@ -868,6 +873,8 @@ void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length) //free intermediate objects g_hash_table_foreach_remove(ref_table, free_index, NULL); + g_ptr_array_free(objects, TRUE); + g_hash_table_destroy(ref_table); //write offsets offset_size = get_needed_bytes(bplist_buff->len); |