[PATCH v2 15/35] util: netdevip: define virNetDevIPAddrFree for use with cleanup macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Define a free function for virNetDevIPAddrPtr type for consistency
and extensibility.

Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@xxxxxxxxx>
---
 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 bf98ed8..7197d07 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 6b509ea..dfc978d 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);
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux