[libvirt] [PATCH 04/12] libxl: use g_autofree in xenParseSxprVifRate

Ján Tomko jtomko at redhat.com
Wed Nov 13 15:48:45 UTC 2019


Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 src/libxl/xen_common.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c
index c31a5c952e..c06ab6e995 100644
--- a/src/libxl/xen_common.c
+++ b/src/libxl/xen_common.c
@@ -1060,7 +1060,7 @@ static const char *vif_bytes_per_sec_re = "^[0-9]+[GMK]?[Bb]/s$";
 static int
 xenParseSxprVifRate(const char *rate, unsigned long long *kbytes_per_sec)
 {
-    char *trate = NULL;
+    g_autofree char *trate = NULL;
     char *p;
     regex_t rec;
     int err;
@@ -1109,7 +1109,6 @@ xenParseSxprVifRate(const char *rate, unsigned long long *kbytes_per_sec)
 
  cleanup:
     regfree(&rec);
-    VIR_FREE(trate);
     return ret;
 }
 
-- 
2.21.0




More information about the libvir-list mailing list