summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Synacek <jsynacek@redhat.com>2019-10-31 14:37:43 +0100
committerJan Synacek <jsynacek@redhat.com>2019-10-31 14:37:46 +0100
commit7050e89ee0e7e1c9983a3f0d6f19364bc529297f (patch)
tree8a1ca41677fec76309b037ae7885c3ee67ca878c /src
parent673d873a42fd6e7821e310cfb81bc37d092c4a22 (diff)
downloadsystemd-7050e89ee0e7e1c9983a3f0d6f19364bc529297f.tar.gz
systemd-7050e89ee0e7e1c9983a3f0d6f19364bc529297f.tar.bz2
systemd-7050e89ee0e7e1c9983a3f0d6f19364bc529297f.zip
sd-dhcp: fix resource leak
CID#1406578
Diffstat (limited to 'src')
-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;