From: Ján Tomko Date: Wed, 8 Jun 2016 14:33:26 +0000 (+0200) Subject: virschematest: call va_end even on OOM X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=09b406a7562963d43b4c743f09fd97fb76777512;p=libvirt.git virschematest: call va_end even on OOM Jump to cleanup if virAsprintf fails. --- diff --git a/tests/virschematest.c b/tests/virschematest.c index c173037900..f15e2ab7c9 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -120,7 +120,7 @@ testSchemaDir(const char *schema, static int testSchemaDirs(const char *schema, ...) { - virXMLValidatorPtr validator; + virXMLValidatorPtr validator = NULL; va_list args; int ret = 0; char *schema_path = NULL; @@ -130,7 +130,7 @@ testSchemaDirs(const char *schema, ...) va_start(args, schema); if (virAsprintf(&schema_path, "%s/docs/schemas/%s", abs_topsrcdir, schema) < 0) - return -1; + goto cleanup; if (!(validator = virXMLValidatorInit(schema_path))) goto cleanup;