提交 a3e3f096 编写于 作者: M Markus Armbruster 提交者: Michael Roth

block/vvfat: Plug memory leak in read_directory()

Has always been leaky.  Spotted by Coverity.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NBenoit Canet <benoit@irqsave.net>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
(cherry picked from commit b122c3b6)
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 7812cbe5
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册