diff options
author | Anita Zhang <the.anitazha@gmail.com> | 2019-10-31 19:39:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-31 19:39:08 +0100 |
commit | 3ec56e53a2f83f07ffdd10343ace6d604717c1f0 (patch) | |
tree | 4e1817b0ad258bc490f4c0929dc68726455376fa /src/libsystemd-network | |
parent | Merge pull request #13891 from yuwata/basic-drop-missing (diff) | |
parent | sd-dhcp: fix resource leak (diff) | |
download | systemd-3ec56e53a2f83f07ffdd10343ace6d604717c1f0.tar.xz systemd-3ec56e53a2f83f07ffdd10343ace6d604717c1f0.zip |
Merge pull request #13895 from jsynacek/master
sd-dhcp: fix resource leak
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-server.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c index 9e1a7698fc..f7022dd715 100644 --- a/src/libsystemd-network/sd-dhcp-server.c +++ b/src/libsystemd-network/sd-dhcp-server.c @@ -151,8 +151,10 @@ _public_ int sd_dhcp_raw_option_new(uint8_t type, char *data, size_t length, sd_ .type = type, }; - if (!p->data) + if (!p->data) { + free(p); return -ENOMEM; + } *ret = p; return 0; |