Explorar o código

capifs: fix memory leak on remount

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>
Cyrill Gorcunov %!s(int64=17) %!d(string=hai) anos
pai
achega
c24e9b3fa3
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      drivers/isdn/capi/capifs.c

+ 1 - 0
drivers/isdn/capi/capifs.c

@@ -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;
 		}