examples-code-check.c: add NULL pointer check before closing file

This fixes CID 1495717.
This commit is contained in:
Olaf Bergmann committed 2020-06-19 16:07:37 +02:00
1 parent ba45a57efc
commit da38169b42
1 file changed
+2 -1
+2 -1
View File
@@ -108,7 +108,8 @@ int main(int argc, char* argv[])
}
if (strncmp(buffer, "DESCRIPTION", sizeof("DESCRIPTION")-1) == 0) {
in_synopsis = 0;
fclose(fpheader);
if (fpheader)
fclose(fpheader);
continue;
}
if (strncmp(buffer, "EXAMPLES", sizeof("EXAMPLES")-1) == 0) {