projects
/
platform
/
upstream
/
curl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d9459b5
)
detect fclose(NULL)
author
Daniel Stenberg
<daniel@haxx.se>
Fri, 8 Mar 2002 15:31:44 +0000
(15:31 +0000)
committer
Daniel Stenberg
<daniel@haxx.se>
Fri, 8 Mar 2002 15:31:44 +0000
(15:31 +0000)
lib/memdebug.c
patch
|
blob
|
history
diff --git
a/lib/memdebug.c
b/lib/memdebug.c
index
2ae203d
..
5f274b7
100644
(file)
--- a/
lib/memdebug.c
+++ b/
lib/memdebug.c
@@
-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);