55ee6ac util: buffer: Introduce VIR_AUTOCLEAN function for virBuffer

Authored and Committed by Peter Krempa 5 years ago
    util: buffer: Introduce VIR_AUTOCLEAN function for virBuffer
    
    virBuffer is almost always stack-allocated, but requires freeing of the
    internals on error. Introduce a VIR_AUTOCLEAN function to deal with
    this.
    
    Along with the addition add a test which would leak the buffer contents
    if it weren't autocleaned.
    
    Signed-off-by: Peter Krempa <pkrempa@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    
        
file modified
+3 -0
file modified
+12 -0