Add missing fclose(3) of fmemopen(3) stream; it does not modify the data.

This commit is contained in:
Todd C. Miller
2021-02-02 13:58:31 -07:00
parent 2fd4a2ad71
commit 20b3904f4f
3 changed files with 16 additions and 10 deletions

View File

@@ -44,7 +44,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
if (size < 5)
return 0;
/* Operate in-memory, do not fclose or it will free() data. */
/* Operate in-memory. */
sudoersin = fmemopen((void *)data, size, "r");
if (sudoersin == NULL)
return 0;
@@ -53,7 +53,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
init_defaults();
init_parser("sudoers", false, true);
sudoersparse();
/* Cleanup. */
init_parser(NULL, false, true);
fclose(fp);
return 0;
}