diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-08-27 17:27:26 +0900 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-10-12 17:51:01 +0200 |
commit | 59bb407d19de624419026b77f152bf7bf5baef7a (patch) | |
tree | 7fc6308d7d497eb380c8bb910d2865e14314a95d | |
parent | a2fa0a2ef4aeb49130e82ce1e12dbaa76b6cd2f5 (diff) | |
download | systemd-59bb407d19de624419026b77f152bf7bf5baef7a.tar.gz |
udev: fix potential memleak
(cherry picked from commit 4154524d47d24bcee3ebfed939912a847ebeb1b3)
(cherry picked from commit f4a8e2c2115fc901e588a1672f129e7e3371f5d7)
-rw-r--r-- | src/udev/udev-builtin-net_id.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index 872833ebbc..e079683b21 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -102,7 +102,6 @@ static int get_virtfn_info(sd_device *dev, struct netnames *names, struct virtfn _cleanup_(sd_device_unrefp) sd_device *physfn_pcidev = NULL; const char *physfn_link_file, *syspath; _cleanup_free_ char *physfn_pci_syspath = NULL; - _cleanup_free_ char *virtfn_pci_syspath = NULL; struct dirent *dent; _cleanup_closedir_ DIR *dir = NULL; char suffix[ALTIFNAMSIZ]; @@ -133,7 +132,7 @@ static int get_virtfn_info(sd_device *dev, struct netnames *names, struct virtfn return -errno; FOREACH_DIRENT_ALL(dent, dir, break) { - _cleanup_free_ char *virtfn_link_file = NULL; + _cleanup_free_ char *virtfn_link_file = NULL, *virtfn_pci_syspath = NULL; if (!startswith(dent->d_name, "virtfn")) continue; |