[CRIU] [PATCH 3/5] parse_mountinfo_ent: kill the wrong xfree(new->mountpoint)

Oleg Nesterov oleg at redhat.com
Sun Mar 29 10:24:02 PDT 2015


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 <oleg at redhat.com>
---
 proc_parse.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/proc_parse.c b/proc_parse.c
index a00bcbb..77b5ac4 100644
--- a/proc_parse.c
+++ b/proc_parse.c
@@ -933,10 +933,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);
 
-- 
1.5.5.1



More information about the CRIU mailing list