This function can be used to free the memory allocated by
ima_get_policy()
Change-Id: I8689c6c7525655bc69299a2f04b5e8a8db143057
Signed-off-by: Janusz Kozerski <j.kozerski@samsung.com>
int ima_get_xattr(const char *path, char **hash);
int evm_set_xattr(const char *path, const char *evm);
int evm_get_xattr(const char *path, char **hash);
+
int ima_get_policy(char*** policy);
+int ima_free_policy(char **policy);
#endif
free(policy_tmp);
return ret_code;
}
+
+int ima_free_policy(char **policy)
+{
+ int i = 0;
+
+ if (!policy)
+ return LIB_ERROR_INPUT_PARAM;
+
+ while (policy[i]) {
+ free(policy[i]);
+ policy[i] = NULL;
+ ++i;
+ }
+ free(policy);
+
+ return LIB_SUCCESS;
+}