multipath: fix clang warning in delegate_to_multipathd
authorMartin Wilck <mwilck@suse.com>
Wed, 7 Mar 2018 23:08:58 +0000 (00:08 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sat, 10 Mar 2018 07:22:16 +0000 (08:22 +0100)
Fixes this warning from clang:

main.c:628:11: warning: variable 'reply' is used uninitialized
whenever 'if' condition is true [-Wsometimes-uninitialized]
...
main.c:609:32: note: initialize the variable 'reply' to silence this warning

Fixes: 506d253b7f89 "multipath: delegate dangerous commands to multipathd"
Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
multipath/main.c

index 8732cf8..716203e 100644 (file)
@@ -606,7 +606,7 @@ int delegate_to_multipathd(enum mpath_cmds cmd, const char *dev,
                           enum devtypes dev_type, const struct config *conf)
 {
        int fd;
-       char command[1024], *p, *reply;
+       char command[1024], *p, *reply = NULL;
        int n, r = 0;
 
        fd = mpath_connect();