From 9798432f567f1589f1da6216e2795ab10b733128 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 24 Feb 2005 18:54:23 +0000 Subject: Fixed some compiler warnings. Fixed a low incidence memory leak in the test server. --- tests/server/getpart.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/server/getpart.c b/tests/server/getpart.c index fa0f9cf52..caa1c32a7 100644 --- a/tests/server/getpart.c +++ b/tests/server/getpart.c @@ -61,11 +61,11 @@ char *appendstring(char *string, /* original string */ { size_t len = strlen(buffer); size_t needed_len = len + *stringlen + 1; - unsigned char *buf64=NULL; + char *buf64=NULL; if(base64) { /* decode the given buffer first */ - len = Curl_base64_decode(buffer, &buf64); /* updated len */ + len = Curl_base64_decode(buffer, (unsigned char**)&buf64); /* updated len */ buffer = buf64; needed_len = len + *stringlen + 1; /* recalculate */ } @@ -79,8 +79,11 @@ char *appendstring(char *string, /* original string */ string = newptr; *stralloc = newsize; } - else + else { + if(buf64) + free(buf64); return NULL; + } } /* memcpy to support binary blobs */ memcpy(&string[*stringlen], buffer, len); -- cgit v1.2.3