]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkctl: fix uninitialized variable
authorRonny Chevalier <chevalier.ronny@gmail.com>
Sat, 30 May 2015 08:51:41 +0000 (10:51 +0200)
committerRonny Chevalier <chevalier.ronny@gmail.com>
Sat, 30 May 2015 09:19:36 +0000 (11:19 +0200)
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.

src/network/networkctl.c

index 69b4ab4a5c6c58ca255dd2687ac63fd8510bee6a..34543949778c67f65704f70fb5d03a13c52c5d09 100644 (file)
@@ -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 */