projects
/
platform
/
upstream
/
curl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78aee26
)
sasl: Fixed memory leak in OAUTH2 message creation
author
Steve Holme
<steve_holme@hotmail.com>
Wed, 23 Oct 2013 23:16:59 +0000
(
00:16
+0100)
committer
Steve Holme
<steve_holme@hotmail.com>
Wed, 23 Oct 2013 23:16:59 +0000
(
00:16
+0100)
lib/curl_sasl.c
patch
|
blob
|
history
diff --git
a/lib/curl_sasl.c
b/lib/curl_sasl.c
index d399d6a7e012fd806f7b03c56cb1402c20bf48e2..52ae2827ceb8039074c4518259fbf026de2187f3 100644
(file)
--- a/
lib/curl_sasl.c
+++ b/
lib/curl_sasl.c
@@
-514,6
+514,7
@@
CURLcode Curl_sasl_create_xoauth2_message(struct SessionHandle *data,
const char *bearer,
char **outptr, size_t *outlen)
{
+ CURLcode result = CURLE_OK;
char *xoauth;
xoauth = aprintf("user=%s\1auth=Bearer %s\1\1", user, bearer);
@@
-522,8
+523,12
@@
CURLcode Curl_sasl_create_xoauth2_message(struct SessionHandle *data,
return CURLE_OUT_OF_MEMORY;
/* Base64 encode the reply */
- return Curl_base64_encode(data, xoauth, strlen(xoauth), outptr,
- outlen);
+ result = Curl_base64_encode(data, xoauth, strlen(xoauth), outptr,
+ outlen);
+
+ Curl_safefree(xoauth);
+
+ return result;
}
/*