From 6752a3ec7a6e7ea35aeac7f699ba7abbbd51ace9 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 13 May 2020 11:47:37 +0200 Subject: [PATCH] virNetDevOpenvswitchConstructVlans: Use g_auto() for virBuffer Signed-off-by: Michal Privoznik --- src/util/virnetdevopenvswitch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c index d16af72bdf..6c4e817941 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -72,7 +72,7 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtV { int ret = -1; size_t i = 0; - virBuffer buf = VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; if (!virtVlan || !virtVlan->nTags) return 0; @@ -113,7 +113,6 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtV } ret = 0; - virBufferFreeAndReset(&buf); return ret; } -- GitLab