]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp6: fix domainname memleak
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 26 Aug 2015 10:37:56 +0000 (12:37 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Wed, 26 Aug 2015 10:37:56 +0000 (12:37 +0200)
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.

src/libsystemd-network/dhcp6-option.c

index 6da7ea7e278363a34814d8138c623cd2cf87f361..2fa4d5fac806a7a1409f624548356034a35c73cb 100644 (file)
@@ -405,7 +405,6 @@ int dhcp6_option_parse_domainname(const uint8_t *optval, uint16_t optlen,
                 if (r < 0)
                         goto fail;
 
-                ret = NULL;
                 idx++;
         }