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
This commit is contained in:
Thomas Haller 2022-01-20 21:52:49 +01:00
parent f73088a885
commit 6f0e22a64a
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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 =