From 66a19eaa4111511d68d567ffe765b0cb201e5083 Mon Sep 17 00:00:00 2001 From: Sukrit Bhatnagar Date: Sat, 28 Jul 2018 23:31:26 +0530 Subject: [PATCH] util: netdevip: Introduce virNetDevIPAddrFree helper This will not only help us in the future when adding more and more VIR_AUTOPTR instances, we're also consistent in that a compound type gets its own function which can easily be extended in the future if necessary. Signed-off-by: Sukrit Bhatnagar Signed-off-by: Erik Skultety --- src/util/virnetdevip.c | 6 ++++++ src/util/virnetdevip.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index bf98ed8a59..7197d07d60 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -1129,3 +1129,9 @@ virNetDevIPInfoAddToDev(const char *ifname, cleanup: return ret; } + +void +virNetDevIPAddrFree(virNetDevIPAddrPtr ip) +{ + VIR_FREE(ip); +} diff --git a/src/util/virnetdevip.h b/src/util/virnetdevip.h index 6b509ea445..dfc978d815 100644 --- a/src/util/virnetdevip.h +++ b/src/util/virnetdevip.h @@ -84,6 +84,7 @@ int virNetDevIPAddrGet(const char *ifname, virSocketAddrPtr addr) int virNetDevIPWaitDadFinish(virSocketAddrPtr *addrs, size_t count) ATTRIBUTE_NONNULL(1); bool virNetDevIPCheckIPv6Forwarding(void); +void virNetDevIPAddrFree(virNetDevIPAddrPtr ip); /* virNetDevIPRoute object */ void virNetDevIPRouteFree(virNetDevIPRoutePtr def);