From 8b5faee7c68b39574dac2cdeabfba1baefe6e7be Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Sun, 29 Mar 2015 19:24:02 +0200 Subject: [PATCH] parse_mountinfo_ent: kill the wrong xfree(new->mountpoint) The caller will do this on failure too. So this is unnecessary and wrong because we do not nullify ->mountpoint. Signed-off-by: Oleg Nesterov Reviewed-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- proc_parse.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/proc_parse.c b/proc_parse.c index e83215cde..1634afd86 100644 --- a/proc_parse.c +++ b/proc_parse.c @@ -958,10 +958,8 @@ static int parse_mountinfo_ent(char *str, struct mount_info *new, char **fsname) &new->mnt_id, &new->parent_mnt_id, &kmaj, &kmin, &new->root, new->mountpoint + 1, &opt, &n); - if (ret != 7) { - xfree(new->mountpoint); + if (ret != 7) return -1; - } new->mountpoint = xrealloc(new->mountpoint, strlen(new->mountpoint) + 1);