]> git.armaanb.net Git - stagit.git/commitdiff
Fix segfault by moving fclose
authorArmaan Bhojwani <me@armaanb.net>
Sun, 18 Apr 2021 17:31:34 +0000 (13:31 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 18 Apr 2021 17:31:34 +0000 (13:31 -0400)
src/stagit-index.c

index bad91d196ad4db01a37e06beb8eebd8763e85842..2a23e8f943dd4de5df20c96ade90564193172515 100644 (file)
@@ -104,8 +104,8 @@ writeheader(char *path)
                        c = fgetc(longdesc);
                }
 #endif
                        c = fgetc(longdesc);
                }
 #endif
+               fclose(longdesc);
        }
        }
-       fclose(longdesc);
 
        fputs("</p>\n<hr/>\n<div id=\"content\">\n"
                "<table id=\"index\"><thead>\n"
 
        fputs("</p>\n<hr/>\n<div id=\"content\">\n"
                "<table id=\"index\"><thead>\n"