]> granicus.if.org Git - python/commitdiff
Coverity CID #168
authorChristian Heimes <christian@cheimes.de>
Fri, 18 Jan 2008 08:53:45 +0000 (08:53 +0000)
committerChristian Heimes <christian@cheimes.de>
Fri, 18 Jan 2008 08:53:45 +0000 (08:53 +0000)
leaked_storage: Returned without freeing storage "fp"

Modules/main.c

index 3d4b9bed8c8d2b6161186b0d177203742d67b6f0..e6409e84a26e4762ead85a27b43732363a67f66b 100644 (file)
@@ -565,6 +565,7 @@ Py_Main(int argc, char **argv)
                                if (fstat(fileno(fp), &sb) == 0 &&
                                    S_ISDIR(sb.st_mode)) {
                                        fprintf(stderr, "%s: '%s' is a directory, cannot continue\n", argv[0], filename);
+                                       fclose(fp);
                                        return 1;
                                }
                        }