utils/module: fix memleak in module_load()
Memory for version_dir, allocated by g_strdup, is not freed Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Frolov <frolov@swemel.ru> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260630110601.736019-1-frolov@swemel.ru> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
This commit is contained in:
committed by
Philippe Mathieu-Daudé
parent
0e51b71c7b
commit
cc4fe73fba
@@ -203,7 +203,7 @@ int module_load(const char *prefix, const char *name, Error **errp)
|
|||||||
{
|
{
|
||||||
int rv = -1;
|
int rv = -1;
|
||||||
#ifdef CONFIG_MODULE_UPGRADES
|
#ifdef CONFIG_MODULE_UPGRADES
|
||||||
char *version_dir;
|
g_autofree char *version_dir = NULL;
|
||||||
#endif
|
#endif
|
||||||
const char *search_dir;
|
const char *search_dir;
|
||||||
char *dirs[5];
|
char *dirs[5];
|
||||||
|
|||||||
Reference in New Issue
Block a user