[CRIU] [PATCH 4/7] mount: Shrink mnt_entry_free a bit

Cyrill Gorcunov gorcunov at openvz.org
Tue Aug 11 07:18:08 PDT 2015


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 mount.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/mount.c b/mount.c
index f70875a72893..736d308857e9 100644
--- a/mount.c
+++ b/mount.c
@@ -2209,14 +2209,13 @@ struct mount_info *mnt_entry_alloc()
 
 void mnt_entry_free(struct mount_info *mi)
 {
-	if (mi == NULL)
-		return;
-
-	xfree(mi->root);
-	xfree(mi->mountpoint);
-	xfree(mi->source);
-	xfree(mi->options);
-	xfree(mi);
+	if (mi) {
+		xfree(mi->root);
+		xfree(mi->mountpoint);
+		xfree(mi->source);
+		xfree(mi->options);
+		xfree(mi);
+	}
 }
 
 /*
-- 
2.4.3



More information about the CRIU mailing list