diff options
Diffstat (limited to 'Source/CTest/Curl/memdebug.c')
-rw-r--r-- | Source/CTest/Curl/memdebug.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/Source/CTest/Curl/memdebug.c b/Source/CTest/Curl/memdebug.c index 9cb22d5..996aebb 100644 --- a/Source/CTest/Curl/memdebug.c +++ b/Source/CTest/Curl/memdebug.c @@ -1,26 +1,26 @@ #ifdef MALLOCDEBUG -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * In order to be useful for every potential user, curl and libcurl are - * dual-licensed under the MPL and the MIT/X-derivate licenses. + * Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al. * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the MPL or the MIT/X-derivate - * licenses. You may pick one of these licenses. + * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * $Id$ - *****************************************************************************/ + ***************************************************************************/ #include "setup.h" @@ -49,7 +49,9 @@ struct memdebug { int size; - char mem[1]; + double mem[1]; + /* I'm hoping this is the thing with the strictest alignment + * requirements. That also means we waste some space :-( */ }; /* @@ -200,7 +202,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); |