diff --git a/tests/test_conf.c b/tests/test_conf.c index 05704df053..4d05d8dd10 100644 --- a/tests/test_conf.c +++ b/tests/test_conf.c @@ -11,7 +11,7 @@ int main(int argc, char **argv) { int ret, exit_code = EXIT_FAILURE; - virConfPtr conf; + virConfPtr conf = NULL; int len = 10000; char *buffer = NULL; @@ -34,7 +34,6 @@ int main(int argc, char **argv) fprintf(stderr, "Failed to serialize %s back\n", argv[1]); goto cleanup; } - virConfFree(conf); if (fwrite(buffer, 1, len, stdout) != len) { fprintf(stderr, "Write failed: %s\n", strerror(errno)); goto cleanup; @@ -44,5 +43,6 @@ int main(int argc, char **argv) cleanup: VIR_FREE(buffer); + virConfFree(conf); return exit_code; }