[sheepdog] [PATCH] dog: fix memory leak in vdi_snapshot()

Yu Yang justyuyang at foxmail.com
Mon May 11 16:17:15 CEST 2015


From: Yu Yang <yuyang at cmss.chinamobile.com>

free the allocated memory in the end of the function.

Signed-off-by: Yu Yang <yuyang at cmss.chinamobile.com>
---
 dog/vdi.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/dog/vdi.c b/dog/vdi.c
index 3766273..3b4673f 100644
--- a/dog/vdi.c
+++ b/dog/vdi.c
@@ -779,6 +779,7 @@ out:
 			sd_err("allowing inode update failed");
 	}
 
+	free(vs);
 	return ret;
 }
 
-- 
1.7.9.5







More information about the sheepdog mailing list