[libvirt PATCH 10/15] rpc: replace VIR_FREE with g_free in all *Dispose() functions

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

 



Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---
 src/rpc/virnetclient.c        |  4 ++--
 src/rpc/virnetdaemon.c        |  6 +++---
 src/rpc/virnetlibsshsession.c | 18 +++++++++---------
 src/rpc/virnetsaslcontext.c   |  2 +-
 src/rpc/virnetserver.c        |  8 ++++----
 src/rpc/virnetserverservice.c |  2 +-
 src/rpc/virnetsocket.c        |  6 +++---
 src/rpc/virnetsshsession.c    |  8 ++++----
 src/rpc/virnettlscontext.c    |  6 +++---
 9 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 2eabacd6e8..edd65941ac 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -747,12 +747,12 @@ void virNetClientDispose(void *obj)
 
     for (i = 0; i < client->nprograms; i++)
         virObjectUnref(client->programs[i]);
-    VIR_FREE(client->programs);
+    g_free(client->programs);
 
     g_main_loop_unref(client->eventLoop);
     g_main_context_unref(client->eventCtx);
 
-    VIR_FREE(client->hostname);
+    g_free(client->hostname);
 
     if (client->sock)
         virNetSocketRemoveIOCallback(client->sock);
diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c
index e337ff1fde..2c18da790b 100644
--- a/src/rpc/virnetdaemon.c
+++ b/src/rpc/virnetdaemon.c
@@ -99,9 +99,9 @@ virNetDaemonDispose(void *obj)
 
     for (i = 0; i < dmn->nsignals; i++) {
         sigaction(dmn->signals[i]->signum, &dmn->signals[i]->oldaction, NULL);
-        VIR_FREE(dmn->signals[i]);
+        g_free(dmn->signals[i]);
     }
-    VIR_FREE(dmn->signals);
+    g_free(dmn->signals);
     VIR_FORCE_CLOSE(dmn->sigread);
     VIR_FORCE_CLOSE(dmn->sigwrite);
     if (dmn->sigwatch > 0)
@@ -109,7 +109,7 @@ virNetDaemonDispose(void *obj)
 #endif /* !WIN32 */
 
     VIR_FORCE_CLOSE(dmn->autoShutdownInhibitFd);
-    VIR_FREE(dmn->stateStopThread);
+    g_free(dmn->stateStopThread);
 
     virHashFree(dmn->servers);
 
diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c
index 48ef914c70..8814487557 100644
--- a/src/rpc/virnetlibsshsession.c
+++ b/src/rpc/virnetlibsshsession.c
@@ -132,18 +132,18 @@ virNetLibsshSessionDispose(void *obj)
 
     for (i = 0; i < sess->nauths; i++) {
         virSecureEraseString(sess->auths[i]->password);
-        VIR_FREE(sess->auths[i]->password);
-        VIR_FREE(sess->auths[i]->filename);
-        VIR_FREE(sess->auths[i]);
+        g_free(sess->auths[i]->password);
+        g_free(sess->auths[i]->filename);
+        g_free(sess->auths[i]);
     }
 
-    VIR_FREE(sess->auths);
+    g_free(sess->auths);
 
-    VIR_FREE(sess->channelCommand);
-    VIR_FREE(sess->hostname);
-    VIR_FREE(sess->knownHostsFile);
-    VIR_FREE(sess->authPath);
-    VIR_FREE(sess->username);
+    g_free(sess->channelCommand);
+    g_free(sess->hostname);
+    g_free(sess->knownHostsFile);
+    g_free(sess->authPath);
+    g_free(sess->username);
 }
 
 static virClassPtr virNetLibsshSessionClass;
diff --git a/src/rpc/virnetsaslcontext.c b/src/rpc/virnetsaslcontext.c
index 9253771787..8a6250120d 100644
--- a/src/rpc/virnetsaslcontext.c
+++ b/src/rpc/virnetsaslcontext.c
@@ -699,7 +699,7 @@ void virNetSASLSessionDispose(void *obj)
 
     if (sasl->conn)
         sasl_dispose(&sasl->conn);
-    VIR_FREE(sasl->callbacks);
+    g_free(sasl->callbacks);
 }
 
 #ifdef __APPLE__
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index fa63acbb09..f0b866a962 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -909,21 +909,21 @@ void virNetServerDispose(void *obj)
     virNetServerPtr srv = obj;
     size_t i;
 
-    VIR_FREE(srv->name);
+    g_free(srv->name);
 
     virThreadPoolFree(srv->workers);
 
     for (i = 0; i < srv->nservices; i++)
         virObjectUnref(srv->services[i]);
-    VIR_FREE(srv->services);
+    g_free(srv->services);
 
     for (i = 0; i < srv->nprograms; i++)
         virObjectUnref(srv->programs[i]);
-    VIR_FREE(srv->programs);
+    g_free(srv->programs);
 
     for (i = 0; i < srv->nclients; i++)
         virObjectUnref(srv->clients[i]);
-    VIR_FREE(srv->clients);
+    g_free(srv->clients);
 }
 
 void virNetServerClose(virNetServerPtr srv)
diff --git a/src/rpc/virnetserverservice.c b/src/rpc/virnetserverservice.c
index 317cacf25b..73232e3747 100644
--- a/src/rpc/virnetserverservice.c
+++ b/src/rpc/virnetserverservice.c
@@ -419,7 +419,7 @@ void virNetServerServiceDispose(void *obj)
 
     for (i = 0; i < svc->nsocks; i++)
        virObjectUnref(svc->socks[i]);
-    VIR_FREE(svc->socks);
+    g_free(svc->socks);
 
     virObjectUnref(svc->tls);
 }
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index e56d43ba85..d0dc59c10c 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -1356,9 +1356,9 @@ void virNetSocketDispose(void *obj)
 
     virProcessAbort(sock->pid);
 
-    VIR_FREE(sock->localAddrStrSASL);
-    VIR_FREE(sock->remoteAddrStrSASL);
-    VIR_FREE(sock->remoteAddrStrURI);
+    g_free(sock->localAddrStrSASL);
+    g_free(sock->remoteAddrStrSASL);
+    g_free(sock->remoteAddrStrURI);
 }
 
 
diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c
index 5bfe311544..f42aed3f62 100644
--- a/src/rpc/virnetsshsession.c
+++ b/src/rpc/virnetsshsession.c
@@ -151,10 +151,10 @@ virNetSSHSessionDispose(void *obj)
 
     virNetSSHSessionAuthMethodsClear(sess);
 
-    VIR_FREE(sess->channelCommand);
-    VIR_FREE(sess->hostname);
-    VIR_FREE(sess->knownHostsFile);
-    VIR_FREE(sess->authPath);
+    g_free(sess->channelCommand);
+    g_free(sess->hostname);
+    g_free(sess->knownHostsFile);
+    g_free(sess->authPath);
 }
 
 static virClassPtr virNetSSHSessionClass;
diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c
index 84f7e63e4d..2936b8ba57 100644
--- a/src/rpc/virnettlscontext.c
+++ b/src/rpc/virnettlscontext.c
@@ -1146,7 +1146,7 @@ void virNetTLSContextDispose(void *obj)
     PROBE(RPC_TLS_CONTEXT_DISPOSE,
           "ctxt=%p", ctxt);
 
-    VIR_FREE(ctxt->priority);
+    g_free(ctxt->priority);
     gnutls_dh_params_deinit(ctxt->dhParams);
     gnutls_certificate_free_credentials(ctxt->x509cred);
 }
@@ -1415,8 +1415,8 @@ void virNetTLSSessionDispose(void *obj)
     PROBE(RPC_TLS_SESSION_DISPOSE,
           "sess=%p", sess);
 
-    VIR_FREE(sess->x509dname);
-    VIR_FREE(sess->hostname);
+    g_free(sess->x509dname);
+    g_free(sess->hostname);
     gnutls_deinit(sess->session);
 }
 
-- 
2.29.2




[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