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 <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-08-20 15:57:06 +10:00
parent a835093321
commit f3a60ca6b3
2 changed files with 2 additions and 2 deletions

View file

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

View file

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