[PATCH 20/23] lxcNetworkParseDataIPs: Automatically free string list

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

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/lxc/lxc_native.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index 9bf079bbb2..347d5f4139 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -548,7 +548,7 @@ lxcNetworkParseDataIPs(const char *name,
                        lxcNetworkParseData *parseData)
 {
     int family = AF_INET;
-    char **ipparts = NULL;
+    g_auto(GStrv) ipparts = NULL;
     g_autofree virNetDevIPAddr *ip = g_new0(virNetDevIPAddr, 1);

     if (STREQ(name, "ipv6") || STREQ(name, "ipv6.address"))
@@ -561,13 +561,9 @@ lxcNetworkParseDataIPs(const char *name,

         virReportError(VIR_ERR_INVALID_ARG,
                        _("Invalid CIDR address: '%s'"), value->str);
-
-        g_strfreev(ipparts);
         return -1;
     }

-    g_strfreev(ipparts);
-
     VIR_APPEND_ELEMENT(parseData->ips, parseData->nips, ip);

     return 0;
-- 
2.31.1




[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