Do not call fclose() on a NULL pointer
The if clause is true if cache is NULL. man 3 fclose says: The behaviour of fclose() is undefined if the stream parameter is an illegal pointer, or is a descriptor already passed to a previous invo‐ cation of fclose(). Check if cache is NULL before calling fclose().
This commit is contained in:
Reference in New Issue
Block a user