浏览代码

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 17 年之前
父节点
当前提交
c24e9b3fa3
共有 1 个文件被更改,包括 1 次插入0 次删除
  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;
 		}