mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
use the curlassert() instead of custom checks
This commit is contained in:
parent
979ba8a8b5
commit
23a6041698
@ -134,11 +134,7 @@ char *curl_dostrdup(const char *str, int line, const char *source)
|
|||||||
char *mem;
|
char *mem;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
if(NULL ==str) {
|
curlassert(str != NULL);
|
||||||
fprintf(stderr, "ILLEGAL strdup() on NULL at %s:%d\n",
|
|
||||||
source, line);
|
|
||||||
exit(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(countcheck("strdup", line, source))
|
if(countcheck("strdup", line, source))
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -184,11 +180,8 @@ void curl_dofree(void *ptr, int line, const char *source)
|
|||||||
{
|
{
|
||||||
struct memdebug *mem;
|
struct memdebug *mem;
|
||||||
|
|
||||||
if(NULL == ptr) {
|
curlassert(ptr != NULL);
|
||||||
fprintf(stderr, "ILLEGAL free() on NULL at %s:%d\n",
|
|
||||||
source, line);
|
|
||||||
exit(2);
|
|
||||||
}
|
|
||||||
mem = (struct memdebug *)((char *)ptr - offsetof(struct memdebug, mem));
|
mem = (struct memdebug *)((char *)ptr - offsetof(struct memdebug, mem));
|
||||||
|
|
||||||
/* destroy */
|
/* destroy */
|
||||||
@ -244,11 +237,7 @@ int curl_fclose(FILE *file, int line, const char *source)
|
|||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
if(NULL == file) {
|
curlassert(file != NULL);
|
||||||
fprintf(stderr, "ILLEGAL flose() on NULL at %s:%d\n",
|
|
||||||
source, line);
|
|
||||||
exit(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
res=(fclose)(file);
|
res=(fclose)(file);
|
||||||
if(logfile)
|
if(logfile)
|
||||||
|
Loading…
Reference in New Issue
Block a user