]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add missing fclose() when applying updates failed (rpz/testlib)
authorOndřej Surý <ondrej@isc.org>
Thu, 15 Aug 2024 07:28:26 +0000 (09:28 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 19 Aug 2024 10:04:19 +0000 (10:04 +0000)
In rpz system tests, we could leak file if the applying the updates has
failed.  Add the missing fclose() before returning.

bin/tests/system/rpz/testlib/test-data.c

index 3ffbce28fe1572ec00791ffed02ba23f21f20e9a..91237d4fef646cadf313f6cbdfecd1516ed6dc85 100644 (file)
@@ -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);
                }
        }