diff options
author | Martin Szulecki | 2013-04-25 16:25:22 +0100 |
---|---|---|
committer | Martin Szulecki | 2013-04-25 16:25:22 +0100 |
commit | 8ae2368031ac51065b569003209aae267b95d5b2 (patch) | |
tree | 13befd2c16f6de15be09d826f45e5338ab06a54a /src | |
parent | b2924a1549d874fb86deaad5fd2438e567c65bf4 (diff) | |
download | libimobiledevice-8ae2368031ac51065b569003209aae267b95d5b2.tar.gz libimobiledevice-8ae2368031ac51065b569003209aae267b95d5b2.tar.bz2 |
afc: Add convenience helper to free AFC dictionaries in afc_dictionary_free()
Diffstat (limited to 'src')
-rw-r--r-- | src/afc.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -1349,3 +1349,17 @@ afc_error_t afc_set_file_time(afc_client_t client, const char *path, uint64_t mt return ret; } +afc_error_t afc_dictionary_free(char **dictionary) +{ + int i = 0; + + if (!dictionary) + return AFC_E_INVALID_ARG; + + for (i = 0; dictionary[i]; i++) { + free(dictionary[i]); + } + free(dictionary); + + return AFC_E_SUCCESS; +} |