[PATCH 07/23] virshEventPrint: Use automatic memory clearing

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

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tools/virsh-domain.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 25097627ac..33984618eb 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -13166,13 +13166,13 @@ static void
 virshEventPrint(virshDomEventData *data,
                 virBuffer *buf)
 {
-    char *msg;
+    g_autofree char *msg = NULL;

     if (!(msg = virBufferContentAndReset(buf)))
         return;

     if (!data->loop && *data->count)
-        goto cleanup;
+        return;

     if (data->timestamp) {
         char timestamp[VIR_TIME_STRING_BUFLEN];
@@ -13188,9 +13188,6 @@ virshEventPrint(virshDomEventData *data,
     (*data->count)++;
     if (!data->loop)
         vshEventDone(data->ctl);
-
- cleanup:
-    VIR_FREE(msg);
 }

 static void
-- 
2.35.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