[CRIU] [PATCH 1/4] autofs: do not close NULL image

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu Mar 24 04:32:03 PDT 2016


This will lead to segmentation fault.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 criu/autofs.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/criu/autofs.c b/criu/autofs.c
index 42c588e..7df2f92 100644
--- a/criu/autofs.c
+++ b/criu/autofs.c
@@ -327,9 +327,10 @@ static int autofs_dump_entry(struct mount_info *pm, AutofsEntry *entry)
 	int ret = -1;
 
 	img = open_image(CR_FD_AUTOFS, O_DUMP, pm->s_dev);
-	if (img)
+	if (img) {
 		ret = pb_write_one(img, entry, PB_AUTOFS);
-	close_image(img);
+		close_image(img);
+	}
 	return ret;
 }
 



More information about the CRIU mailing list