diff options
author | Martin Szulecki | 2014-06-21 00:59:38 +0200 |
---|---|---|
committer | Martin Szulecki | 2014-06-21 00:59:38 +0200 |
commit | 79fc1ededbbafba3204b952cc022b089a38547dd (patch) | |
tree | 2abd55a5a5aeceb4c23965af8ef3f30168551581 /tools | |
parent | 5b075e0c309db2290d02c862b975be2c90158ff7 (diff) | |
download | libimobiledevice-79fc1ededbbafba3204b952cc022b089a38547dd.tar.gz libimobiledevice-79fc1ededbbafba3204b952cc022b089a38547dd.tar.bz2 |
idevicebackup2: Use afc_dictionary_free() helper instead of custom code
Diffstat (limited to 'tools')
-rw-r--r-- | tools/idevicebackup2.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index 5f14862..35d3ccb 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c @@ -109,19 +109,6 @@ static void notify_cb(const char *notification, void *userdata) } } -static void free_dictionary(char **dictionary) -{ - int i = 0; - - if (!dictionary) - return; - - for (i = 0; dictionary[i]; i++) { - free(dictionary[i]); - } - free(dictionary); -} - static void mobilebackup_afc_get_file_contents(afc_client_t afc, const char *filename, char **data, uint64_t *size) { if (!afc || !data || !size) { @@ -130,7 +117,7 @@ static void mobilebackup_afc_get_file_contents(afc_client_t afc, const char *fil char **fileinfo = NULL; uint32_t fsize = 0; - + afc_get_file_info(afc, filename, &fileinfo); if (!fileinfo) { return; @@ -142,12 +129,12 @@ static void mobilebackup_afc_get_file_contents(afc_client_t afc, const char *fil break; } } - free_dictionary(fileinfo); + afc_dictionary_free(fileinfo); if (fsize == 0) { return; } - + uint64_t f = 0; afc_file_open(afc, filename, AFC_FOPEN_RDONLY, &f); if (!f) { |