summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorAnita Zhang <the.anitazha@gmail.com>2019-10-31 19:39:08 +0100
committerGitHub <noreply@github.com>2019-10-31 19:39:08 +0100
commit3ec56e53a2f83f07ffdd10343ace6d604717c1f0 (patch)
tree4e1817b0ad258bc490f4c0929dc68726455376fa /src/libsystemd-network
parentMerge pull request #13891 from yuwata/basic-drop-missing (diff)
parentsd-dhcp: fix resource leak (diff)
downloadsystemd-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.c4
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;