diff options
author | Martin Szulecki | 2014-03-21 02:06:51 +0100 |
---|---|---|
committer | Martin Szulecki | 2014-03-21 02:06:51 +0100 |
commit | 80d3d2cfa9ae1c6cc8b0e004373e8bc8c368dd56 (patch) | |
tree | a51e972463000df88f4f48cf04f707ecc95b6a09 /common | |
parent | b5fa8eea8b41950af18db373d15115e0c900d3d4 (diff) | |
download | libimobiledevice-80d3d2cfa9ae1c6cc8b0e004373e8bc8c368dd56.tar.gz libimobiledevice-80d3d2cfa9ae1c6cc8b0e004373e8bc8c368dd56.tar.bz2 |
userpref: Fix invalid plist_free() which caused pair process to fail
Diffstat (limited to 'common')
-rw-r--r-- | common/userpref.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/common/userpref.c b/common/userpref.c index 65f1988..3399036 100644 --- a/common/userpref.c +++ b/common/userpref.c @@ -1006,6 +1006,7 @@ userpref_error_t pair_record_get_item_as_key_data(plist_t pair_record, const cha if (!pair_record || !value) return USERPREF_E_INVALID_ARG; + userpref_error_t ret = USERPREF_E_SUCCESS; char* buffer = NULL; uint64_t length = 0; @@ -1018,12 +1019,14 @@ userpref_error_t pair_record_get_item_as_key_data(plist_t pair_record, const cha value->size = length; free(buffer); buffer = NULL; + } else { + ret = USERPREF_E_INVALID_CONF; } - if (node) - plist_free(node); + if (buffer) + free(buffer); - return USERPREF_E_SUCCESS; + return ret; } userpref_error_t pair_record_set_item_from_key_data(plist_t pair_record, const char* name, key_data_t *value) |