From f1405af84cb3ad8f7340c70bbae621da0125e145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 15 Aug 2024 09:28:26 +0200 Subject: [PATCH] Add missing fclose() when applying updates failed (rpz/testlib) In rpz system tests, we could leak file if the applying the updates has failed. Add the missing fclose() before returning. (cherry picked from commit 2855ec8f5f963a487acc217e7de38f0fbfbc4343) --- bin/tests/system/rpz/testlib/test-data.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/tests/system/rpz/testlib/test-data.c b/bin/tests/system/rpz/testlib/test-data.c index 3ffbce28fe..91237d4fef 100644 --- a/bin/tests/system/rpz/testlib/test-data.c +++ b/bin/tests/system/rpz/testlib/test-data.c @@ -1352,6 +1352,7 @@ load_all_updates(const char *fname, trpz_result_t **presults, size_t *pnresults, { fprintf(stderr, "Error: could not apply update \"%s\"\n", lptr); + fclose(f); return (-1); } }