From: David Herrmann Date: Wed, 26 Aug 2015 10:37:56 +0000 (+0200) Subject: sd-dhcp6: fix domainname memleak X-Git-Tag: v225~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a00458421dd4b6fcb9b4cdc433ba0c13970907f1;p=thirdparty%2Fsystemd.git sd-dhcp6: fix domainname memleak strv_extend() does not consume the passed entry, hence, we must properly free it. Furthermore, we should *not* use strv_consume() as we do greedy allocations on 'ret'; and greedy-allocations should only be used for short lived objects or caches. Fix the domainname parser to properly free temporary storage when done. --- diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c index 6da7ea7e278..2fa4d5fac80 100644 --- a/src/libsystemd-network/dhcp6-option.c +++ b/src/libsystemd-network/dhcp6-option.c @@ -405,7 +405,6 @@ int dhcp6_option_parse_domainname(const uint8_t *optval, uint16_t optlen, if (r < 0) goto fail; - ret = NULL; idx++; }