aboutsummaryrefslogtreecommitdiff
path: root/block/vvfat.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-05-28 11:17:05 +0200
committerKevin Wolf <kwolf@redhat.com>2014-05-30 14:26:54 +0200
commitb122c3b6d020e529b203836efb8f611ece787293 (patch)
treea638e8eaf28f52f96136149ae8e8c7d4f0a6d973 /block/vvfat.c
parent6262bbd363b53a1f19c473345d7cc40254dd5c73 (diff)
block/vvfat: Plug memory leak in read_directory()
Has always been leaky. 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>
Diffstat (limited to 'block/vvfat.c')
-rw-r--r--block/vvfat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/vvfat.c b/block/vvfat.c
index 56370c5c93..3cda19f2f3 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -787,7 +787,9 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)
s->current_mapping->path=buffer;
s->current_mapping->read_only =
(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) == 0;
- }
+ } else {
+ g_free(buffer);
+ }
}
closedir(dir);