mirror of
https://github.com/systemd/systemd.git
synced 2026-08-09 01:20:53 +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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user