]> git.hungrycats.org Git - linux/commitdiff
[PATCH] SELinux: null dereference in error path
authorAlexander Nyberg <alexn@dsv.su.se>
Tue, 1 Mar 2005 03:47:45 +0000 (19:47 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 1 Mar 2005 03:47:45 +0000 (19:47 -0800)
The 'bad' label will call function that unconditionally dereferences the
NULL pointer.

Found by the Coverity tool

Signed-off-by: Alexander Nyberg <alexn@dsv.su.se>
Acked-by: James Morris <jmorris@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
security/selinux/ss/policydb.c

index 7fc245f3ac320e28643abb1b8d9340d14bd17ef4..46bc7b6bc79eee1741c07aa0c1f3510f9420f4ad 100644 (file)
@@ -773,7 +773,7 @@ static int class_read(struct policydb *p, struct hashtab *h, void *fp)
        cladatum = kmalloc(sizeof(*cladatum), GFP_KERNEL);
        if (!cladatum) {
                rc = -ENOMEM;
-               goto bad;
+               goto out;
        }
        memset(cladatum, 0, sizeof(*cladatum));