[Ocfs2-tools-devel] [PATCH 4/4] mounted.ocfs2: evaluating a garbage value 'proc'
chuanchang.jia at gmail.com
chuanchang.jia at gmail.com
Sat Sep 17 20:47:23 PDT 2011
mounted.ocfs2: evaluating a garbage value 'proc'.
Signed-off-by: Alex Jia <chuanchang.jia at gmail.com>
---
mounted.ocfs2/mounted.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/mounted.ocfs2/mounted.c b/mounted.ocfs2/mounted.c
index f76556c..7de2140 100644
--- a/mounted.ocfs2/mounted.c
+++ b/mounted.ocfs2/mounted.c
@@ -289,7 +289,7 @@ static errcode_t build_partition_list(struct list_head *dev_list, char *device)
ret = ocfs2_malloc0(sizeof(ocfs2_devices), &dev);
if (ret)
- goto bail;
+ goto out;
/*
* Try to translate private device-mapper dm-<N> names
@@ -339,6 +339,11 @@ bail:
fclose(proc);
return ret;
+
+out:
+ if (ret && dev)
+ ocfs2_free(&dev);
+ return ret;
}
static void usage(char *progname)
--
1.7.1
More information about the Ocfs2-tools-devel
mailing list