MemoryTracking: adjust initialization calling
Calling of curl_memdebug() was still done with a pending free()
This commit is contained in:
@@ -119,7 +119,7 @@ static long memsize = 0; /* set number of mallocs allowed */
|
||||
void curl_memdebug(const char *logname)
|
||||
{
|
||||
if(!logfile) {
|
||||
if(logname)
|
||||
if(logname && *logname)
|
||||
logfile = fopen(logname, "w");
|
||||
else
|
||||
logfile = stderr;
|
||||
|
||||
@@ -32,14 +32,12 @@
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#define CURL_MT_LOGFNAME_BUFSIZE 512
|
||||
|
||||
#define logfile curl_debuglogfile
|
||||
|
||||
extern FILE *logfile;
|
||||
|
||||
Reference in New Issue
Block a user