summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/libimobiledevice/afc.h1
-rw-r--r--src/afc.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/include/libimobiledevice/afc.h b/include/libimobiledevice/afc.h
index d262650..faf1b10 100644
--- a/include/libimobiledevice/afc.h
+++ b/include/libimobiledevice/afc.h
@@ -115,6 +115,7 @@ afc_error_t afc_set_file_time(afc_client_t client, const char *path, uint64_t mt
/* Helper functions */
afc_error_t afc_get_device_info_key(afc_client_t client, const char *key, char **value);
+afc_error_t afc_dictionary_free(char **dictionary);
#ifdef __cplusplus
}
diff --git a/src/afc.c b/src/afc.c
index f39562d..f8ca27c 100644
--- a/src/afc.c
+++ b/src/afc.c
@@ -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;
+}