diff options
author | Tom Gundersen <teg@jklm.no> | 2014-04-29 21:57:11 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-04-29 21:57:59 +0200 |
commit | bc4155669aaf567e2d6fa1f1082d68012346629e (patch) | |
tree | 071d48848766b4490ebc2183394631f7c9fa28ea /src | |
parent | d38cbe1bb7382782226b4b72944c9f7a7cf3eca1 (diff) |
sd-dhcp-lease: fix double realloc
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-lease.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c index 648e6e2159..acdcca87ec 100644 --- a/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/libsystemd-network/sd-dhcp-lease.c @@ -330,12 +330,13 @@ static int deserialize_addresses(struct in_addr **addresses, size_t *size, const new_addresses = realloc(*addresses, (*size + 1) * sizeof(struct in_addr)); if (!new_addresses) return -ENOMEM; + else + *addresses = new_addresses; r = inet_aton(word, &(new_addresses[*size])); if (r < 0) continue; - *addresses = new_addresses; (*size)++; } |