From: Markus Armbruster Date: Wed, 28 May 2014 09:17:04 +0000 (+0200) Subject: block/vvfat: Plug memory leak in check_directory_consistency() X-Git-Tag: v2.0.1~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=53bdfb5b62eee7a29c7a479bb87b47d941a30812;p=thirdparty%2Fqemu.git block/vvfat: Plug memory leak in check_directory_consistency() On error path. Introduced in commit a046433a. Spotted by Coverity. Signed-off-by: Markus Armbruster Reviewed-by: Benoit Canet Signed-off-by: Kevin Wolf (cherry picked from commit 6262bbd363b53a1f19c473345d7cc40254dd5c73) Signed-off-by: Michael Roth --- diff --git a/block/vvfat.c b/block/vvfat.c index 439a603c2a5..91c63f7d805 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1866,7 +1866,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;