[patch 2/3] CAPIFS: fix memory leak on remount

From: Cyrill Gorcunov
Date: Wed Apr 16 2008 - 13:48:43 EST


capifs_remount may reach 'return' statement
without freeing of memory allocated by kstrdup call

Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>

---

Index: linux-2.6.git/drivers/isdn/capi/capifs.c
===================================================================
--- linux-2.6.git.orig/drivers/isdn/capi/capifs.c 2008-04-16 20:14:46.000000000 +0400
+++ linux-2.6.git/drivers/isdn/capi/capifs.c 2008-04-16 20:16:58.000000000 +0400
@@ -69,6 +69,7 @@ static int capifs_remount(struct super_b
} 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;
}

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/