summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-08-06 08:53:24 +0200
committerDaniel Mack <daniel@zonque.org>2015-08-06 08:54:29 +0200
commit92d0218ed10160cc54bcd06334e26dfd2b88dd7a (patch)
tree2247f026f759bf0a21ae6fa36e418f0124b0c705 /src/libsystemd-network
parentb747102da75de64972ad7101ee2cbb5416008b30 (diff)
libsystemd-network: plug memory leak
Coverity #1315324
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/sd-dhcp-lease.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
index eae186c9d3..e0874aebad 100644
--- a/src/libsystemd-network/sd-dhcp-lease.c
+++ b/src/libsystemd-network/sd-dhcp-lease.c
@@ -965,8 +965,10 @@ int sd_dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file) {
return r;
r = dhcp_lease_insert_private_option(lease, DHCP_OPTION_PRIVATE_BASE + i, data, len);
- if (r < 0)
+ if (r < 0) {
+ free(data);
return r;
+ }
}
*ret = lease;