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

Ján Tomko posted 12 patches 6 years, 2 months ago
[libvirt] [PATCH 04/12] libxl: use g_autofree in xenParseSxprVifRate
Posted by Ján Tomko 6 years, 2 months ago
Signed-off-by: Ján Tomko <jtomko@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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 04/12] libxl: use g_autofree in xenParseSxprVifRate
Posted by Peter Krempa 6 years, 2 months ago
On Wed, Nov 13, 2019 at 16:48:45 +0100, Ján Tomko wrote:
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>  src/libxl/xen_common.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list