[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-288-g1cdefe8ac
wwp at claws-mail.org
wwp at claws-mail.org
Mon Oct 4 00:34:45 CEST 2021
The branch, gtk3 has been updated
via 1cdefe8acb372cc3bc8626d5559d001ea3289d5b (commit)
from 148912d837227a7db693eab56c39a383fe54087d (commit)
Summary of changes:
src/oauth2.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit 1cdefe8acb372cc3bc8626d5559d001ea3289d5b
Author: wwp <subscript at free.fr>
Date: Mon Oct 4 00:33:51 2021 +0200
Fix (or better fix for) CID 1491155, 1491195 and 1491351: resource leaks.
diff --git a/src/oauth2.c b/src/oauth2.c
index 3e8195a7a..626666889 100644
--- a/src/oauth2.c
+++ b/src/oauth2.c
@@ -215,7 +215,7 @@ int oauth2_obtain_tokens (Oauth2Service provider, OAUTH2Data *OAUTH2Data, const
gchar *request;
gchar *response;
gchar *body;
- gchar *uri;
+ gchar *uri, *uri2;
gchar *header;
gchar *tmp_hd, *tmp_hd_encoded;
gchar *access_token;
@@ -260,7 +260,6 @@ int oauth2_obtain_tokens (Oauth2Service provider, OAUTH2Data *OAUTH2Data, const
access_token = g_malloc(OAUTH2BUFSIZE+1);
request = g_malloc(OAUTH2BUFSIZE+1);
response = g_malloc(OAUTH2BUFSIZE+1);
- body = g_malloc(OAUTH2BUFSIZE+1);
if(OAUTH2Data->custom_client_id)
client_id = g_strdup(OAUTH2Data->custom_client_id);
@@ -268,8 +267,9 @@ int oauth2_obtain_tokens (Oauth2Service provider, OAUTH2Data *OAUTH2Data, const
client_id = oauth2_decode(OAUTH2info[i][OA2_CLIENT_ID]);
uri = g_uri_escape_string (client_id, NULL, FALSE);
- body = g_strconcat ("client_id=", uri,
- "&code=",g_uri_escape_string (token, NULL, FALSE), NULL);
+ uri2 = g_uri_escape_string (token, NULL, FALSE);
+ body = g_strconcat ("client_id=", uri, "&code=", uri2, NULL);
+ g_free(uri2);
g_free(uri);
g_free(token);
@@ -408,7 +408,6 @@ gint oauth2_use_refresh_token (Oauth2Service provider, OAUTH2Data *OAUTH2Data)
access_token = g_malloc(OAUTH2BUFSIZE+1);
request = g_malloc(OAUTH2BUFSIZE+1);
response = g_malloc(OAUTH2BUFSIZE+1);
- body = g_malloc(OAUTH2BUFSIZE+1);
if(OAUTH2Data->custom_client_id)
client_id = g_strdup(OAUTH2Data->custom_client_id);
@@ -416,7 +415,7 @@ gint oauth2_use_refresh_token (Oauth2Service provider, OAUTH2Data *OAUTH2Data)
client_id = oauth2_decode(OAUTH2info[i][OA2_CLIENT_ID]);
uri = g_uri_escape_string (client_id, NULL, FALSE);
- body = g_strconcat ("client_id=", uri, "&refresh_token=",OAUTH2Data->refresh_token, NULL);
+ body = g_strconcat ("client_id=", uri, "&refresh_token=", OAUTH2Data->refresh_token, NULL);
g_free(uri);
if(OAUTH2info[i][OA2_CLIENT_SECRET][0]){
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list