profiles can be pinned by file and other references, and can live long
after they have been replaced/removed. The rawdata however is no longer
needed, and can be freed earlier than the rest of the profile.
Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
aa_label_remove(&profile->label);
__aafs_profile_rmdir(profile);
__list_remove_profile(profile);
+ /* rawdata is only ever referenced by fs lookup, that is no
+ * longer possible here, so put the reference to it. This will
+ * enable the rawdata to be freed if for some reason the profile
+ * is pinned and going to live for a while.
+ */
+ aa_put_profile_loaddata(profile->rawdata);
+ profile->rawdata = NULL;
}
/**