[Debian-ha-commits] [ocfs2-tools] 14/58: o2image: Free 'filepath' before return in prompt_image_creation()
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Tue Jun 20 13:40:40 UTC 2017
This is an automated email from the git hooks/post-receive script.
vvidic-guest pushed a commit to branch upstream
in repository ocfs2-tools.
commit c23a0163a766d1b3b0a3cf274e4db9dabf38229d
Author: Jun Piao <piaojun at huawei.com>
Date: Wed Jul 13 17:42:50 2016 +0800
o2image: Free 'filepath' before return in prompt_image_creation()
A memory leak problem is found in prompt_image_creation(), 'filepath'
need to be freed before return.
Signed-off-by: Jun Piao <piaojun at huawei.com>
Reviewed-by: Joseph Qi <joseph.qi at huawei.com>
---
o2image/o2image.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/o2image/o2image.c b/o2image/o2image.c
index 465e7fe..ce70fcb 100644
--- a/o2image/o2image.c
+++ b/o2image/o2image.c
@@ -674,9 +674,11 @@ static int prompt_image_creation(ocfs2_filesys *ofs, int rawflg, char *filename)
img_size/1024, free_spc/1024);
if (toupper(getchar()) != 'Y') {
fprintf(stdout, "Aborting image creation.\n");
+ ocfs2_free(&filepath);
return 0;
}
+ ocfs2_free(&filepath);
return 1;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/ocfs2-tools.git
More information about the Debian-HA-Commits
mailing list