From f3a60ca6b32a870eb812da5fa63840e1a52dee3a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 20 Aug 2020 15:57:06 +1000 Subject: [PATCH] Fix maybe-uninitialized warnings Building with a releaes build reshuffles things so this ends causing potential issues. Initialize to NULL to avoid around this. Signed-off-by: Peter Hutterer --- src/libei-socket.c | 2 +- src/libeis-socket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libei-socket.c b/src/libei-socket.c index a30bb08..50e3027 100644 --- a/src/libei-socket.c +++ b/src/libei-socket.c @@ -85,7 +85,7 @@ ei_setup_backend_socket(struct ei *ei, const char *socketpath) assert(socketpath); assert(socketpath[0] != '\0'); - _cleanup_free_ char *path; + _cleanup_free_ char *path = NULL; if (socketpath[0] == '/') { path = xstrdup(socketpath); } else { diff --git a/src/libeis-socket.c b/src/libeis-socket.c index 664c17a..ceb5b24 100644 --- a/src/libeis-socket.c +++ b/src/libeis-socket.c @@ -104,7 +104,7 @@ eis_setup_backend_socket(struct eis *eis, const char *socketpath) _cleanup_(eis_socket_cleanup) struct eis_socket *eis_socket = eis_socket_create(&eis->object); - _cleanup_free_ char *path; + _cleanup_free_ char *path = NULL; if (socketpath[0] == '/') { path = xstrdup(socketpath); } else {