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>
This commit is contained in:
parent
30d55e71a8
commit
c24e9b3fa3
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user