From: Ronny Chevalier Date: Sat, 30 May 2015 08:51:41 +0000 (+0200) Subject: networkctl: fix uninitialized variable X-Git-Tag: v221~238 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;ds=sidebyside;h=732b7f39a2b3b1a2af90102c6262186ae71197ac;p=thirdparty%2Fsystemd.git networkctl: fix uninitialized variable We ignore the return value of sd_device_get_devtype, then devtype could be uninitialized when used with streq_ptr. So we need to initialize it first. --- diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 69b4ab4a5c6..34543949778 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -62,7 +62,7 @@ static int link_get_type_string(int iftype, sd_device *d, char **ret) { assert(ret); if (iftype == ARPHRD_ETHER && d) { - const char *devtype, *id = NULL; + const char *devtype = NULL, *id = NULL; /* WLANs have iftype ARPHRD_ETHER, but we want * to show a more useful type string for * them */