By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.
Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
char *out;
const char *cur;
virBufferEscapePair escapeItem;
- virBufferEscapePairPtr escapeList = NULL;
+ VIR_AUTOPTR(virBufferEscapePair) escapeList = NULL;
size_t nescapeList = 0;
va_list ap;
cleanup:
va_end(ap);
- VIR_FREE(escapeList);
}