]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
socket-util: initialize variable with cleanup attribute 18910/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 7 Mar 2021 01:31:26 +0000 (10:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 7 Mar 2021 01:32:36 +0000 (10:32 +0900)
Follow-up for 83e03c4fc23dae0cbb3fd4e7c2f9ef533fc26160.

Fixes CID#1448460.

src/basic/socket-util.c

index fc90161745a69195af0becb990b278d8f6558e19..8402e79c312c6622276add2610f3c46eeba6a2fd 100644 (file)
@@ -298,7 +298,7 @@ bool socket_ipv6_is_supported(void) {
 }
 
 bool socket_ipv6_is_enabled(void) {
-        _cleanup_free_ char *v;
+        _cleanup_free_ char *v = NULL;
         int r;
 
         /* Much like socket_ipv6_is_supported(), but also checks that the sysctl that disables IPv6 on all