mirror of
https://github.com/curl/curl.git
synced 2026-05-18 00:16:20 +03:00
detect fclose(NULL)
This commit is contained in:
parent
d9459b54d9
commit
fe3c874001
1 changed files with 9 additions and 1 deletions
|
|
@ -200,7 +200,15 @@ FILE *curl_fopen(const char *file, const char *mode,
|
|||
|
||||
int curl_fclose(FILE *file, int line, const char *source)
|
||||
{
|
||||
int res=(fclose)(file);
|
||||
int res;
|
||||
|
||||
if(NULL == file) {
|
||||
fprintf(stderr, "ILLEGAL flose() on NULL at %s:%d\n",
|
||||
source, line);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
res=(fclose)(file);
|
||||
if(logfile)
|
||||
fprintf(logfile, "FILE %s:%d fclose(%p)\n",
|
||||
source, line, file);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue