From 6329f1db5ac75ee3b7d2f7ce062e951a598625fe Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 20 Jan 2022 21:52:49 +0100 Subject: [PATCH] libnm/tests: fix maybe-uninitialized warning in "test-setting" In function '_nm_auto_g_free', inlined from 'test_tc_config_tfilter_matchall_mirred' at src/libnm-core-impl/tests/test-setting.c:2955:24: ./src/libnm-glib-aux/nm-macros-internal.h:58:1: error: 'str' may be used uninitialized [-Werror=maybe-uninitialized] 58 | NM_AUTO_DEFINE_FCN_VOID0(void *, _nm_auto_g_free, g_free); | ^ src/libnm-core-impl/tests/test-setting.c: In function 'test_tc_config_tfilter_matchall_mirred': src/libnm-core-impl/tests/test-setting.c:2955:24: note: 'str' was declared here 2955 | gs_free char *str; | ^ lto1: all warnings being treated as errors lto-wrapper: fatal error: gcc returned 1 exit status (cherry picked from commit 6f0e22a64a4d8acd93c7fce08492cbfbd26bd330) --- src/libnm-core-impl/tests/test-setting.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libnm-core-impl/tests/test-setting.c b/src/libnm-core-impl/tests/test-setting.c index 7444f2c143..f77ecc7792 100644 --- a/src/libnm-core-impl/tests/test-setting.c +++ b/src/libnm-core-impl/tests/test-setting.c @@ -2952,7 +2952,7 @@ test_tc_config_tfilter_matchall_mirred(void) NMTCTfilter * tfilter1; GError * error = NULL; gs_strfreev char **attr_names = NULL; - gs_free char * str; + gs_free char * str = NULL; GVariant * variant; tfilter1 =