[lxc-devel] [PATCH 1/6] coverity: free malloc'ed memory in error case

Dwight Engen dwight.engen at oracle.com
Tue May 7 14:57:03 UTC 2013


Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
---
 src/lxc/bdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c
index 35351a9..1a611f9 100644
--- a/src/lxc/bdev.c
+++ b/src/lxc/bdev.c
@@ -1203,6 +1203,8 @@ static int overlayfs_clonepaths(struct bdev *orig, struct bdev *new, const char
 			return -ENOMEM;
 		}
 		if (do_rsync(odelta, ndelta) < 0) {
+			free(osrc);
+			free(ndelta);
 			ERROR("copying overlayfs delta");
 			return -1;
 		}
-- 
1.8.1.4






More information about the lxc-devel mailing list