From: Kaifeng Zhu Date: Fri, 7 Mar 2014 16:52:47 +0000 (+0000) Subject: block-vvfat: fix memory leak in check_directory_consistency() X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1f9e474fca9b15b27f8f97220d165cd9f83a1fb0;p=qemu-xen-4.6-testing.git block-vvfat: fix memory leak in check_directory_consistency() Memory pointed by cluster leaks in error handling code. Signed-off-by: Kaifeng Zhu Coverity-ID: 1055917 Reviewed-by: Andrew Cooper --- diff --git a/block-vvfat.c b/block-vvfat.c index ec3363cb0..6cd57a2a6 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;