diff options
author | Yang Tse <yangsita@gmail.com> | 2011-05-23 16:55:49 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2011-05-23 16:55:49 +0200 |
commit | 41ebda02b2062b0752f9723aaa5d545384165905 (patch) | |
tree | 6bfad275043611c9f2125f9571e1073d92eca4d6 | |
parent | 30c9799f72f3275f806a296e1100ad04c942706c (diff) |
compiler warning: fix
Fix compiler warning: expression has no effect
Fix OOM handling
-rw-r--r-- | lib/base64.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/base64.c b/lib/base64.c index ae7e436ff..3e59f5f46 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -140,6 +140,7 @@ size_t Curl_base64_encode(struct SessionHandle *data, const char *inputbuff, size_t insize, char **outptr) { + CURLcode res; unsigned char ibuf[3]; unsigned char obuf[4]; 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 * 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; + } if(convbuf) indata = (char *)convbuf; |