diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-08-18 12:11:02 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-09-30 19:11:36 +0200 |
commit | a4c13869f95cb45d657cc1df3803f633221d4971 (patch) | |
tree | 8ebf036c107ff7aad647eb31d070fafe7115bb82 /os-posix.c | |
parent | 05512f55aaca92505b75d8fa6818b088a5eeb07f (diff) | |
download | qemu-a4c13869f95cb45d657cc1df3803f633221d4971.zip qemu-a4c13869f95cb45d657cc1df3803f633221d4971.tar.gz qemu-a4c13869f95cb45d657cc1df3803f633221d4971.tar.bz2 |
oslib: do not call g_strdup from qemu_get_exec_dir
Just return the directory without requiring the caller to free it.
This also removes a bogus check for NULL in os_find_datadir and
module_load_one; g_strdup of a static variable cannot return NULL.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'os-posix.c')
-rw-r--r-- | os-posix.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -90,13 +90,9 @@ void os_setup_signal_handling(void) */ char *os_find_datadir(void) { - g_autofree char *exec_dir = NULL; g_autofree char *dir = NULL; - exec_dir = qemu_get_exec_dir(); - g_return_val_if_fail(exec_dir != NULL, NULL); - - dir = g_build_filename(exec_dir, "pc-bios", NULL); + dir = g_build_filename(qemu_get_exec_dir(), "pc-bios", NULL); if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { return g_steal_pointer(&dir); } |