]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix the build on non-linux platforms after VIR_AUTOPTR related changes
authorErik Skultety <eskultet@redhat.com>
Tue, 7 Aug 2018 16:40:11 +0000 (18:40 +0200)
committerErik Skultety <eskultet@redhat.com>
Wed, 8 Aug 2018 08:07:10 +0000 (10:07 +0200)
Commits 7b706f33ac and 4acb7887e4 introduced some compound type *Free
wrappers in order to use them with VIR_DEFINE_AUTOPTR_FUNC. However,
since those were not used in the code right away, Clang complained about
unused functions (static ones that are defined by the macro above).
This patch puts the defined functions in use.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virnetdev.c
src/util/virnetlink.c

index 9eca786c95da4284ecde5e4d21fb809b56276119..8eac419725325669788851cdb66a4ff37e73ac04 100644 (file)
@@ -2833,7 +2833,7 @@ static int virNetDevGetMcastList(const char *ifname,
     char *buf = NULL;
     char *next = NULL;
     int ret = -1, len;
-    virNetDevMcastEntryPtr entry = NULL;
+    VIR_AUTOPTR(virNetDevMcastEntry) entry = NULL;
 
     mcast->entries = NULL;
     mcast->nentries = 0;
@@ -2867,7 +2867,6 @@ static int virNetDevGetMcastList(const char *ifname,
     ret = 0;
  cleanup:
     VIR_FREE(buf);
-    VIR_FREE(entry);
 
     return ret;
 }
index 2702c12d24f10a630bd7bde83ed4d3fd29be94ee..162efe6f99598cf1b53075aab9976d6b86828533 100644 (file)
@@ -305,7 +305,7 @@ int virNetlinkCommand(struct nl_msg *nl_msg,
             .nl_groups = 0,
     };
     struct pollfd fds[1];
-    virNetlinkHandle *nlhandle = NULL;
+    VIR_AUTOPTR(virNetlinkHandle) nlhandle = NULL;
     int len = 0;
 
     memset(fds, 0, sizeof(fds));
@@ -333,7 +333,6 @@ int virNetlinkCommand(struct nl_msg *nl_msg,
         *respbuflen = 0;
     }
 
-    virNetlinkFree(nlhandle);
     return ret;
 }
 
@@ -355,7 +354,7 @@ virNetlinkDumpCommand(struct nl_msg *nl_msg,
             .nl_pid    = dst_pid,
             .nl_groups = 0,
     };
-    virNetlinkHandle *nlhandle = NULL;
+    VIR_AUTOPTR(virNetlinkHandle) nlhandle = NULL;
 
     if (!(nlhandle = virNetlinkSendRequest(nl_msg, src_pid, nladdr,
                                            protocol, groups)))
@@ -382,7 +381,6 @@ virNetlinkDumpCommand(struct nl_msg *nl_msg,
 
  cleanup:
     VIR_FREE(resp);
-    virNetlinkFree(nlhandle);
     return ret;
 }