From: Michal Privoznik Date: Mon, 13 Aug 2018 09:16:06 +0000 (+0200) Subject: virnetdevip: Free data.devices in virNetDevIPCheckIPv6Forwarding() too X-Git-Tag: v4.7.0-rc1~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1019607610e78ea1e908b402dcfce3909fce237;p=thirdparty%2Flibvirt.git virnetdevip: Free data.devices in virNetDevIPCheckIPv6Forwarding() too We are freeing the individual strings (which were filled by virNetDevIPCheckIPv6ForwardingCallback()) but not the array itself. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index c6d6175627..866ddcc213 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -651,8 +651,7 @@ virNetDevIPCheckIPv6Forwarding(void) cleanup: nlmsg_free(nlmsg); - for (i = 0; i < data.ndevices; i++) - VIR_FREE(data.devices[i]); + virStringListFreeCount(data.devices, data.ndevices); return valid; }