mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 11:52:20 +00:00
virschematest: call va_end even on OOM
Jump to cleanup if virAsprintf fails.
This commit is contained in:
parent
609ba3a751
commit
09b406a756
@ -120,7 +120,7 @@ testSchemaDir(const char *schema,
|
|||||||
static int
|
static int
|
||||||
testSchemaDirs(const char *schema, ...)
|
testSchemaDirs(const char *schema, ...)
|
||||||
{
|
{
|
||||||
virXMLValidatorPtr validator;
|
virXMLValidatorPtr validator = NULL;
|
||||||
va_list args;
|
va_list args;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
char *schema_path = NULL;
|
char *schema_path = NULL;
|
||||||
@ -130,7 +130,7 @@ testSchemaDirs(const char *schema, ...)
|
|||||||
va_start(args, schema);
|
va_start(args, schema);
|
||||||
|
|
||||||
if (virAsprintf(&schema_path, "%s/docs/schemas/%s", abs_topsrcdir, schema) < 0)
|
if (virAsprintf(&schema_path, "%s/docs/schemas/%s", abs_topsrcdir, schema) < 0)
|
||||||
return -1;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(validator = virXMLValidatorInit(schema_path)))
|
if (!(validator = virXMLValidatorInit(schema_path)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user