Skip to content

Commit

Permalink
block/vvfat: Plug memory leak in read_directory()
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit b122c3b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
Markus Armbruster authored and mdroth committed Aug 5, 2014
1 parent 7812cbe commit a3e3f09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion block/vvfat.c
Expand Up @@ -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);

Expand Down

0 comments on commit a3e3f09

Please sign in to comment.