aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2005-02-24 18:54:23 +0000
committerDan Fandrich <dan@coneharvesters.com>2005-02-24 18:54:23 +0000
commit9798432f567f1589f1da6216e2795ab10b733128 (patch)
treea67ccc3343ffdf961101fdefbfb08f2eddbc0ff9
parent5faf52619d730a4527f51a7eb335c88499cbabed (diff)
Fixed some compiler warnings. Fixed a low incidence memory leak in the test server.
-rw-r--r--lib/http_negotiate.c6
-rw-r--r--tests/server/getpart.c9
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
index 68f769913..bfcef84ac 100644
--- a/lib/http_negotiate.c
+++ b/lib/http_negotiate.c
@@ -166,7 +166,7 @@ int Curl_input_negotiate(struct connectdata *conn, char *header)
len = strlen(header);
if (len > 0) {
- int rawlen = Curl_base64_decode(header, &input_token.value);
+ int rawlen = Curl_base64_decode(header, (unsigned char **)&input_token.value);
if (rawlen < 0)
return -1;
input_token.length = rawlen;
@@ -206,7 +206,7 @@ int Curl_input_negotiate(struct connectdata *conn, char *header)
input_token.length = mechTokenLength;
free(mechToken);
mechToken = NULL;
- infof(conn->data, "Parse SPNEGO Target Token succeded\n");
+ infof(conn->data, "Parse SPNEGO Target Token succeeded\n");
}
}
#endif
@@ -287,7 +287,7 @@ CURLcode Curl_output_negotiate(struct connectdata *conn)
neg_ctx->output_token.length = spnegoTokenLength;
free(spnegoToken);
spnegoToken = NULL;
- infof(conn->data, "Make SPNEGO Initial Token succeded\n");
+ infof(conn->data, "Make SPNEGO Initial Token succeeded\n");
}
}
#endif
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);