X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/5b8e6b4cc279e4434ddda94a6b2848834883ec9c..149ea099cdee4857f9af7125682f7dadf23c8ac8:/os-posix.c diff --git a/os-posix.c b/os-posix.c index 107fde38bf..c6ddb7d830 100644 --- a/os-posix.c +++ b/os-posix.c @@ -26,7 +26,6 @@ #include "qemu/osdep.h" #include /*needed for MAP_POPULATE before including qemu-options.h */ -#include #include #include #include @@ -90,7 +89,7 @@ char *os_find_datadir(void) if (exec_dir == NULL) { return NULL; } - dir = dirname(exec_dir); + dir = g_path_get_dirname(exec_dir); max_len = strlen(dir) + MAX(strlen(SHARE_SUFFIX), strlen(BUILD_SUFFIX)) + 1; @@ -104,6 +103,7 @@ char *os_find_datadir(void) } } + g_free(dir); g_free(exec_dir); return res; }