Skip to content

Commit 5606e32

Browse files
committed
parse: fix uninitialized variable
Fixes the build on Fedora 41: In file included from /usr/include/glib-2.0/glib.h:117, from ../src/parse.c:25: In function ‘g_autoptr_cleanup_generic_gfree’, inlined from ‘get_ip_family’ at ../src/parse.c:1918:22: /usr/include/glib-2.0/glib/glib-autocleanups.h:32:3: error: ‘ip_str’ may be used uninitialized [-Werror=maybe-uninitialized] 32 | g_free (*pp); | ^~~~~~~~~~~~ ../src/parse.c: In function ‘get_ip_family’: ../src/parse.c:1918:22: note: ‘ip_str’ was declared here 1918 | g_autofree char *ip_str; | ^~~~~~ cc1: all warnings being treated as errors
1 parent 2392ad4 commit 5606e32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,7 @@ handle_vxlan_tristate(NetplanParser* npp, yaml_node_t* node, const void* data, G
19251925
STATIC int
19261926
get_ip_family(const char* address)
19271927
{
1928-
g_autofree char *ip_str;
1928+
g_autofree char *ip_str = NULL;
19291929
char *prefix_len;
19301930

19311931
ip_str = g_strdup(address);

0 commit comments

Comments
 (0)