X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Fbase64.c;h=6b87eed40015ddbc496b166408ace5d9780479f4;hb=8a08705db260779441360e959b97b6c172f8acb0;hp=6b1eb7c9cbe32893409b77c5d4cac310e951e96d;hpb=f7bbc1c9b6a8e2c815d09612b53f453c90d962e0;p=platform%2Fupstream%2Fcurl.git diff --git a/lib/base64.c b/lib/base64.c index 6b1eb7c..6b87eed 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -23,17 +23,14 @@ /* Base64 encoding/decoding */ #include "curl_setup.h" - -#define _MPRINTF_REPLACE /* use our functions only */ -#include - +#include "curl_printf.h" #include "urldata.h" /* for the SessionHandle definition */ #include "warnless.h" #include "curl_base64.h" -#include "curl_memory.h" #include "non-ascii.h" -/* include memdebug.h last */ +/* The last #include files should be: */ +#include "curl_memory.h" #include "memdebug.h" /* ---- Base64 Encoding/Decoding Table --- */ @@ -152,7 +149,7 @@ CURLcode Curl_base64_decode(const char *src, for(i = 0; i < numQuantums; i++) { size_t result = decodeQuantum(pos, src); if(!result) { - Curl_safefree(newstr); + free(newstr); return CURLE_BAD_CONTENT_ENCODING; } @@ -255,8 +252,7 @@ static CURLcode base64_encode(const char *table64, *output = '\0'; *outptr = base64data; /* return pointer to new data, allocated memory */ - if(convbuf) - free(convbuf); + free(convbuf); *outlen = strlen(base64data); /* return the length of the new data */