projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6262bbd
)
block/vvfat: Plug memory leak in read_directory()
author
Markus Armbruster
<armbru@redhat.com>
Wed, 28 May 2014 09:17:05 +0000
(11:17 +0200)
committer
Kevin Wolf
<kwolf@redhat.com>
Fri, 30 May 2014 12:26:54 +0000
(14:26 +0200)
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>
block/vvfat.c
patch
|
blob
|
history
diff --git
a/block/vvfat.c
b/block/vvfat.c
index 56370c5c93476389e5956805d5ade5c421562f91..3cda19f2f3b9c5153d1baa2325af20e75246490f 100644
(file)
--- 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);