]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix some minor resource leaks 313/head
authorryancaicse <73822648+ryancaicse@users.noreply.github.com>
Tue, 21 Dec 2021 04:12:27 +0000 (12:12 +0800)
committerGitHub <noreply@github.com>
Tue, 21 Dec 2021 04:12:27 +0000 (12:12 +0800)
Fix some minor resource leaks in test18n.c

cups/testi18n.c

index 4a67c93ba28aae01fff8def44962f600e68309bd..7be0fa2770ede960e573e5b23713a0244100827a 100644 (file)
@@ -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);
       }