]> xenbits.xensource.com Git - qemu-xen-unstable.git/commitdiff
block-vvfat: fix memory leak in check_directory_consistency()
authorKaifeng Zhu <kaifeng.zhu@citrix.com>
Fri, 7 Mar 2014 16:52:47 +0000 (16:52 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 16 Oct 2015 15:52:07 +0000 (16:52 +0100)
Memory pointed by cluster leaks in error handling code.

Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
Coverity-ID: 1055917
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
block-vvfat.c

index ec3363cb02b6fd422767e8bf939fcd98b2fc18d5..6cd57a2a6276bf7cb301f7b903b7a4baa0e69c4b 100644 (file)
@@ -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;