summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-05-28 11:17:04 +0200
committerKevin Wolf <kwolf@redhat.com>2014-05-30 14:26:54 +0200
commit6262bbd363b53a1f19c473345d7cc40254dd5c73 (patch)
treef2baf5494a5596372968b468711d2d20ae81b7a3
parentf25391c2a6ef1674384204265429520ea50e82bc (diff)
downloadfocaccia-qemu-6262bbd363b53a1f19c473345d7cc40254dd5c73.tar.gz
focaccia-qemu-6262bbd363b53a1f19c473345d7cc40254dd5c73.zip
block/vvfat: Plug memory leak in check_directory_consistency()
On error path.  Introduced in commit a046433a.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block/vvfat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/vvfat.c b/block/vvfat.c
index 811b39c1ca..56370c5c93 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;