mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
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.
This commit is contained in:
parent
8f42ccd24b
commit
732b7f39a2
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue