aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-08-18 12:11:02 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-30 19:11:36 +0200
commita4c13869f95cb45d657cc1df3803f633221d4971 (patch)
tree8ebf036c107ff7aad647eb31d070fafe7115bb82 /include
parent05512f55aaca92505b75d8fa6818b088a5eeb07f (diff)
downloadqemu-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 'include')
-rw-r--r--include/qemu/osdep.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index dad44be..f9ec8c8 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -597,12 +597,8 @@ char *qemu_get_local_state_pathname(const char *relative_pathname);
* Try OS specific API first, if not working, parse from argv0. */
void qemu_init_exec_dir(const char *argv0);
-/* Get the saved exec dir.
- *
- * The caller is responsible for releasing the value returned with g_free()
- * after use.
- */
-char *qemu_get_exec_dir(void);
+/* Get the saved exec dir. */
+const char *qemu_get_exec_dir(void);
/**
* qemu_getauxval: