"unconfined",
};
-
/* requires profile list write lock held */
void __aa_update_proxy(struct aa_profile *orig, struct aa_profile *new)
{
free_proxy(p);
}
+/**
+ * aa_free_data - free a data blob
+ * @ptr: data to free
+ * @arg: unused
+ */
+static void aa_free_data(void *ptr, void *arg)
+{
+ struct aa_data *data = ptr;
+
+ kzfree(data->data);
+ kzfree(data->key);
+ kzfree(data);
+}
+
/**
* aa_free_profile - free a profile
* @profile: the profile to free (MAYBE NULL)
*/
void aa_free_profile(struct aa_profile *profile)
{
+ struct rhashtable *rht;
+
AA_DEBUG("%s(%p)\n", __func__, profile);
if (!profile)
aa_put_dfa(profile->policy.dfa);
aa_put_proxy(profile->proxy);
+ if (profile->data) {
+ rht = profile->data;
+ profile->data = NULL;
+ rhashtable_free_and_destroy(rht, aa_free_data, NULL);
+ kzfree(rht);
+ }
+
kzfree(profile->hash);
aa_put_loaddata(profile->rawdata);
kzfree(profile);