summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-dhcp-lease.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-07-12 14:10:39 -0400
committerDaniel Mack <github@zonque.org>2015-07-12 14:10:39 -0400
commit89a2faeed5abf9ee284c157c1940a5ac1d829f9b (patch)
treed89026ced870f184d808d6e252a5c6c498616da0 /src/libsystemd-network/sd-dhcp-lease.c
parent9e400131f799e7cb565bf2865b874d876cb2937f (diff)
parent13a5d76b3277a2a499345cc24facc21eb17ccdae (diff)
Merge pull request #566 from teg/util-base64-2
util: add base64 handling
Diffstat (limited to 'src/libsystemd-network/sd-dhcp-lease.c')
-rw-r--r--src/libsystemd-network/sd-dhcp-lease.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
index d8bc76edda..7548e50b7d 100644
--- a/src/libsystemd-network/sd-dhcp-lease.c
+++ b/src/libsystemd-network/sd-dhcp-lease.c
@@ -811,13 +811,12 @@ int sd_dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file) {
}
if (client_id_hex) {
- if (strlen (client_id_hex) % 2)
+ if (strlen(client_id_hex) % 2)
return -EINVAL;
- lease->client_id = unhexmem (client_id_hex, strlen (client_id_hex));
- if (!lease->client_id)
- return -ENOMEM;
- lease->client_id_len = strlen (client_id_hex) / 2;
+ r = unhexmem(client_id_hex, strlen(client_id_hex), (void**) &lease->client_id, &lease->client_id_len);
+ if (r < 0)
+ return r;
}
*ret = lease;