mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
util: buffer: use VIR_AUTOPTR for aggregate types
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>
This commit is contained in:
parent
013a7b9ef2
commit
d0a92a0371
@ -694,7 +694,7 @@ virBufferEscapeN(virBufferPtr buf,
|
||||
char *out;
|
||||
const char *cur;
|
||||
virBufferEscapePair escapeItem;
|
||||
virBufferEscapePairPtr escapeList = NULL;
|
||||
VIR_AUTOPTR(virBufferEscapePair) escapeList = NULL;
|
||||
size_t nescapeList = 0;
|
||||
va_list ap;
|
||||
|
||||
@ -752,7 +752,6 @@ virBufferEscapeN(virBufferPtr buf,
|
||||
|
||||
cleanup:
|
||||
va_end(ap);
|
||||
VIR_FREE(escapeList);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user