diff options
Diffstat (limited to 'src/libsystemd/sd-network/sd-network.c')
-rw-r--r-- | src/libsystemd/sd-network/sd-network.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-network/sd-network.c b/src/libsystemd/sd-network/sd-network.c index 552ec381b6..7273a77156 100644 --- a/src/libsystemd/sd-network/sd-network.c +++ b/src/libsystemd/sd-network/sd-network.c @@ -340,7 +340,7 @@ static int network_link_get_ifindexes(int ifindex, const char *key, int **ret) { char path[STRLEN("/run/systemd/netif/links/") + DECIMAL_STR_MAX(ifindex) + 1]; _cleanup_free_ int *ifis = NULL; _cleanup_free_ char *s = NULL; - size_t allocated = 0, c = 0; + size_t c = 0; int r; assert_return(ifindex > 0, -EINVAL); @@ -362,7 +362,7 @@ static int network_link_get_ifindexes(int ifindex, const char *key, int **ret) { if (r == 0) break; - if (!GREEDY_REALLOC(ifis, allocated, c + 2)) + if (!GREEDY_REALLOC(ifis, c + 2)) return -ENOMEM; r = ifis[c++] = parse_ifindex(word); |