On 12/19/19 4:09 PM, Daniel Henrique Barboza wrote:
Change all feasible pointers to use g_autoptr().
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/qemu/qemu_process.c | 113 +++++++++++++---------------------------
1 file changed, 37 insertions(+), 76 deletions(-)
@@ -6718,7 +6684,7 @@ qemuProcessLaunch(virConnectPtr conn,
qemuDomainObjPrivatePtr priv = vm->privateData;
virCommandPtr cmd = NULL;
struct qemuProcessHookData hookData;
- virQEMUDriverConfigPtr cfg;
+ g_autoptr(virQEMUDriverConfig) cfg = NULL;
size_t nnicindexes = 0;
g_autofree int *nicindexes = NULL;
size_t i;
@@ -7026,7 +6992,6 @@ qemuProcessLaunch(virConnectPtr conn,
qemuDomainSecretDestroy(vm);
virCommandFree(cmd);
virCommand supports autoptr too
virObjectUnref(logCtxt);
Could add a prep patch in qemu_domain.h with:
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDomainLogContext, virObjectUnref);
Then use it here too
- Cole