capifs: fix memory leak on remount
authorCyrill Gorcunov <gorcunov@gmail.com>
Mon, 28 Apr 2008 09:14:41 +0000 (02:14 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Apr 2008 15:58:34 +0000 (08:58 -0700)
capifs_remount may reach 'return' statement without freeing of memory
allocated by kstrdup call

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/isdn/capi/capifs.c

index eafe0e9daa7ceb88eadd9eadcce9e1123a42e22d..550e80f390a63f87da84f84e9ec0290f75ca7151 100644 (file)
@@ -69,6 +69,7 @@ static int capifs_remount(struct super_block *s, int *flags, char *data)
                } else if (sscanf(this_char, "mode=%o%c", &n, &dummy) == 1)
                        mode = n & ~S_IFMT;
                else {
+                       kfree(new_opt);
                        printk("capifs: called with bogus options\n");
                        return -EINVAL;
                }