[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 26/32] block-vvfat: fix memory leak in check_directory_consistency()



From: Kaifeng Zhu <kaifeng.zhu@xxxxxxxxxx>

Memory pointed by cluster leaks in error handling code.

Signed-off-by: Kaifeng Zhu <kaifeng.zhu@xxxxxxxxxx>
Coverity-ID: 1055917
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 block-vvfat.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block-vvfat.c b/block-vvfat.c
index ec3363c..6cd57a2 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -1769,7 +1769,7 @@ static int check_directory_consistency(BDRVVVFATState *s,
 
        if (s->used_clusters[cluster_num] & USED_ANY) {
            fprintf(stderr, "cluster %d used more than once\n", 
(int)cluster_num);
-           return 0;
+           goto fail;
        }
        s->used_clusters[cluster_num] = USED_DIRECTORY;
 
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.