On Sun, Jun 03, 2018 at 01:42:10PM +0530, Sukrit Bhatnagar wrote:
Modify code to use VIR_AUTOFREE macro wherever required.
Signed-off-by: Sukrit Bhatnagar <skrtbhtngr(a)gmail.com>
---
src/util/virdbus.c | 28 +++++++---------------------
1 file changed, 7 insertions(+), 21 deletions(-)
diff --git a/src/util/virdbus.c b/src/util/virdbus.c
index ba8b684..66dbe41 100644
--- a/src/util/virdbus.c
+++ b/src/util/virdbus.c
@@ -614,9 +614,8 @@ virDBusMessageIterEncode(DBusMessageIter *rootiter,
size_t nstack = 0;
size_t siglen;
size_t skiplen;
- char *contsig = NULL;
const char *vsig;
- DBusMessageIter *newiter = NULL;
+ VIR_AUTOFREE(DBusMessageIter *) newiter = NULL;
Doh!...and here we are facing a potential exception to the rule I mentioned in
one of the previous patches about compound types and VIR_AUTOFREE...Sigh,
although possible, I really don't think we want to introduce *Free helpers for
external types like ^this...that's honestly my only argument to support my
earlier claim about the VIR_AUTOFREE usage with scalar types only.
It's not a "libvirt-native" type, so let's close our eyes and forget
that we're
doing this.
Erik