From c2f795275ddcdbda5c68a5a868573cbbe2510189 Mon Sep 17 00:00:00 2001 From: ryancaicse <73822648+ryancaicse@users.noreply.github.com> Date: Tue, 21 Dec 2021 12:12:27 +0800 Subject: [PATCH] Fix some minor resource leaks Fix some minor resource leaks in test18n.c --- cups/testi18n.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cups/testi18n.c b/cups/testi18n.c index 4a67c93ba2..7be0fa2770 100644 --- a/cups/testi18n.c +++ b/cups/testi18n.c @@ -167,6 +167,7 @@ main(int argc, /* I - Argument Count */ if (encoding == CUPS_AUTO_ENCODING) { fprintf(stderr, "%s: Unknown character set!\n", argv[2]); + fclose(fp); return (1); } @@ -175,6 +176,7 @@ main(int argc, /* I - Argument Count */ if (cupsCharsetToUTF8(utf8dest, line, sizeof(utf8dest), encoding) < 0) { fprintf(stderr, "%s: Unable to convert line: %s", argv[1], line); + fclose(fp); return (1); } -- 2.47.2