Signed-off-by: Laine Stump <laine(a)redhat.com>
---
src/network/bridge_driver.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 0f5212ce04..9f37d8f558 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -332,7 +332,7 @@ networkRunHook(virNetworkObjPtr obj,
int sub_op)
{
virNetworkDefPtr def;
- virBuffer buf = VIR_BUFFER_INITIALIZER;
+ g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
char *xml = NULL;
int hookret;
int ret = -1;
@@ -370,7 +370,6 @@ networkRunHook(virNetworkObjPtr obj,
ret = 0;
cleanup:
- virBufferFreeAndReset(&buf);
VIR_FREE(xml);
return ret;
}
@@ -1093,7 +1092,7 @@ networkDnsmasqConfContents(virNetworkObjPtr obj,
dnsmasqCapsPtr caps G_GNUC_UNUSED)
{
virNetworkDefPtr def = virNetworkObjGetDef(obj);
- virBuffer configbuf = VIR_BUFFER_INITIALIZER;
+ g_auto(virBuffer) configbuf = VIR_BUFFER_INITIALIZER;
int r, ret = -1;
int nbleases = 0;
size_t i;
@@ -1577,7 +1576,6 @@ networkDnsmasqConfContents(virNetworkObjPtr obj,
cleanup:
VIR_FREE(saddr);
VIR_FREE(eaddr);
- virBufferFreeAndReset(&configbuf);
return ret;
}
@@ -1843,7 +1841,7 @@ networkRadvdConfContents(virNetworkObjPtr obj,
char **configstr)
{
virNetworkDefPtr def = virNetworkObjGetDef(obj);
- virBuffer configbuf = VIR_BUFFER_INITIALIZER;
+ g_auto(virBuffer) configbuf = VIR_BUFFER_INITIALIZER;
int ret = -1;
size_t i;
virNetworkIPDefPtr ipdef;
@@ -1907,7 +1905,6 @@ networkRadvdConfContents(virNetworkObjPtr obj,
ret = 0;
cleanup:
- virBufferFreeAndReset(&configbuf);
return ret;
}
--
2.25.4