[mutter] test-utils: Fix compiler warning
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] test-utils: Fix compiler warning
- Date: Wed, 19 Jun 2019 11:30:40 +0000 (UTC)
commit 446e82e86db3b4e0ea2fb84c8345983fbcfd56b8
Author: Hans de Goede <hdegoede redhat com>
Date: Wed Jun 19 12:54:02 2019 +0200
test-utils: Fix compiler warning
This fixes the following compiler warning:
In file included from /usr/include/glib-2.0/glib.h:114,
from ../src/tests/test-utils.h:23,
from ../src/tests/test-utils.c:22:
../src/tests/test-utils.c: In function ‘test_init’:
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: warning: ‘basename’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
28 | g_free (*pp);
| ^~~~~~~~~~~~
../src/tests/test-utils.c:73:24: note: ‘basename’ was declared here
73 | g_autofree char *basename;
| ^~~~~~~~
https://gitlab.gnome.org/GNOME/mutter/merge_requests/627
src/tests/test-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/tests/test-utils.c b/src/tests/test-utils.c
index 980b20acd..a42005451 100644
--- a/src/tests/test-utils.c
+++ b/src/tests/test-utils.c
@@ -70,7 +70,7 @@ ensure_test_client_path (int argc,
if (!g_file_test (test_client_path,
G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE))
{
- g_autofree char *basename;
+ g_autofree char *basename = NULL;
g_autofree char *dirname = NULL;
basename = g_path_get_basename (argv[0]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]