Merge tag 'apparmor-pr-2019-12-03' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / security / apparmor / policy.c
index ade333074c8ed50263999e231b9750842ef2ef6d..03104830c9132a38574407a32a2c87536dbea8f6 100644 (file)
@@ -582,7 +582,7 @@ static int replacement_allowed(struct aa_profile *profile, int noreplace,
 {
        if (profile) {
                if (profile->label.flags & FLAG_IMMUTIBLE) {
-                       *info = "cannot replace immutible profile";
+                       *info = "cannot replace immutable profile";
                        return -EPERM;
                } else if (noreplace) {
                        *info = "profile already exists";
@@ -856,7 +856,7 @@ static struct aa_profile *update_to_newest_parent(struct aa_profile *new)
 ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label,
                            u32 mask, struct aa_loaddata *udata)
 {
-       const char *ns_name, *info = NULL;
+       const char *ns_name = NULL, *info = NULL;
        struct aa_ns *ns = NULL;
        struct aa_load_ent *ent, *tmp;
        struct aa_loaddata *rawdata_ent;
@@ -1043,6 +1043,7 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label,
 out:
        aa_put_ns(ns);
        aa_put_loaddata(udata);
+       kfree(ns_name);
 
        if (error)
                return error;