1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

compiler warning: fix

Fix compiler warning: expression has no effect

Fix OOM handling
This commit is contained in:
Yang Tse 2011-05-23 16:55:49 +02:00
parent 30c9799f72
commit 41ebda02b2

View File

@ -140,6 +140,7 @@ size_t Curl_base64_encode(struct SessionHandle *data,
const char *inputbuff, size_t insize, const char *inputbuff, size_t insize,
char **outptr) char **outptr)
{ {
CURLcode res;
unsigned char ibuf[3]; unsigned char ibuf[3];
unsigned char obuf[4]; unsigned char obuf[4];
int i; int i;
@ -164,8 +165,11 @@ size_t Curl_base64_encode(struct SessionHandle *data,
* not the host encoding. And we can't change the actual input * not the host encoding. And we can't change the actual input
* so we copy it to a buffer, translate it, and use that instead. * so we copy it to a buffer, translate it, and use that instead.
*/ */
if(Curl_convert_clone(data, indata, insize, &convbuf)) res = Curl_convert_clone(data, indata, insize, &convbuf);
if(res) {
free(output);
return 0; return 0;
}
if(convbuf) if(convbuf)
indata = (char *)convbuf; indata = (char *)convbuf;