Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- tests/commandhelper.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/commandhelper.c b/tests/commandhelper.c index 3bd7d2b28d..940a979a3f 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -306,39 +306,31 @@ static int printInput(struct Arguments *args) } int main(int argc, char **argv) { - struct Arguments *args = parseArguments(argc, argv); - FILE *log = fopen(abs_builddir "/commandhelper.log", "w"); - int ret = EXIT_FAILURE; + g_autoptr(Arguments) args = parseArguments(argc, argv); + g_autoptr(FILE) log = fopen(abs_builddir "/commandhelper.log", "w"); if (!log || !args) - goto cleanup; + return EXIT_FAILURE; printArguments(log, argc, argv); if (printEnvironment(log) != 0) - goto cleanup; + return EXIT_FAILURE; if (printFds(log) != 0) - goto cleanup; + return EXIT_FAILURE; printDaemonization(log, args); if (printCwd(log) != 0) - goto cleanup; + return EXIT_FAILURE; fprintf(log, "UMASK:%04o\n", umask(0)); if (printInput(args) != 0) - goto cleanup; + return EXIT_FAILURE; - ret = EXIT_SUCCESS; - - cleanup: - if (args) - free(args); - if (log) - fclose(log); - return ret; + return EXIT_SUCCESS; } #else -- 2.26.2