mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
tests: Use full force of our VIR_AUTO* machinery in testBackingXMLjsonXML
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
0973dbd841
commit
5f13df4cf4
@ -43,14 +43,14 @@ static int
|
|||||||
testBackingXMLjsonXML(const void *args)
|
testBackingXMLjsonXML(const void *args)
|
||||||
{
|
{
|
||||||
const struct testBackingXMLjsonXMLdata *data = args;
|
const struct testBackingXMLjsonXMLdata *data = args;
|
||||||
xmlDocPtr xml = NULL;
|
VIR_AUTOPTR(xmlDoc) xml = NULL;
|
||||||
xmlXPathContextPtr ctxt = NULL;
|
VIR_AUTOPTR(xmlXPathContext) ctxt = NULL;
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
VIR_AUTOCLEAN(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
virJSONValuePtr backendprops = NULL;
|
VIR_AUTOPTR(virJSONValue) backendprops = NULL;
|
||||||
virJSONValuePtr wrapper = NULL;
|
VIR_AUTOPTR(virJSONValue) wrapper = NULL;
|
||||||
char *propsstr = NULL;
|
VIR_AUTOFREE(char *) propsstr = NULL;
|
||||||
char *protocolwrapper = NULL;
|
VIR_AUTOFREE(char *) protocolwrapper = NULL;
|
||||||
char *actualxml = NULL;
|
VIR_AUTOFREE(char *) actualxml = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
VIR_AUTOUNREF(virStorageSourcePtr) xmlsrc = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) xmlsrc = NULL;
|
||||||
VIR_AUTOUNREF(virStorageSourcePtr) jsonsrc = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) jsonsrc = NULL;
|
||||||
@ -104,15 +104,6 @@ testBackingXMLjsonXML(const void *args)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(propsstr);
|
|
||||||
VIR_FREE(protocolwrapper);
|
|
||||||
VIR_FREE(actualxml);
|
|
||||||
virJSONValueFree(backendprops);
|
|
||||||
virJSONValueFree(wrapper);
|
|
||||||
virBufferFreeAndReset(&buf);
|
|
||||||
xmlXPathFreeContext(ctxt);
|
|
||||||
xmlFreeDoc(xml);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user