summaryrefslogtreecommitdiff
path: root/imap/src/c-client
diff options
context:
space:
mode:
Diffstat (limited to 'imap/src/c-client')
-rw-r--r--imap/src/c-client/auth_bea.c3
-rw-r--r--imap/src/c-client/auth_oa2.c3
-rw-r--r--imap/src/c-client/mail.c1
-rw-r--r--imap/src/c-client/oauth2_aux.c6
4 files changed, 11 insertions, 2 deletions
diff --git a/imap/src/c-client/auth_bea.c b/imap/src/c-client/auth_bea.c
index e05a5007..d6dca992 100644
--- a/imap/src/c-client/auth_bea.c
+++ b/imap/src/c-client/auth_bea.c
@@ -155,5 +155,8 @@ long auth_oauthbearer_client (authchallenge_t challenger,authrespond_t responder
if(oauth2.param[OA2_Id].value) fs_give((void **) &oauth2.param[OA2_Id].value);
if(oauth2.param[OA2_Secret].value) fs_give((void **) &oauth2.param[OA2_Secret].value);
if(oauth2.param[OA2_Tenant].value) fs_give((void **) &oauth2.param[OA2_Tenant].value);
+ if(oauth2.param[OA2_State].value) fs_give((void **) &oauth2.param[OA2_State].value);
+ if(oauth2.param[OA2_RefreshToken].value) fs_give((void **) &oauth2.param[OA2_RefreshToken].value);
+ if(oauth2.access_token) fs_give((void **) &oauth2.access_token);
return ret;
}
diff --git a/imap/src/c-client/auth_oa2.c b/imap/src/c-client/auth_oa2.c
index 7fb30542..2f52c4f2 100644
--- a/imap/src/c-client/auth_oa2.c
+++ b/imap/src/c-client/auth_oa2.c
@@ -174,5 +174,8 @@ long auth_oauth2_client (authchallenge_t challenger,authrespond_t responder, cha
if(oauth2.param[OA2_Id].value) fs_give((void **) &oauth2.param[OA2_Id].value);
if(oauth2.param[OA2_Secret].value) fs_give((void **) &oauth2.param[OA2_Secret].value);
if(oauth2.param[OA2_Tenant].value) fs_give((void **) &oauth2.param[OA2_Tenant].value);
+ if(oauth2.param[OA2_State].value) fs_give((void **) &oauth2.param[OA2_State].value);
+ if(oauth2.param[OA2_RefreshToken].value) fs_give((void **) &oauth2.param[OA2_RefreshToken].value);
+ if(oauth2.access_token) fs_give((void **) &oauth2.access_token);
return ret;
}
diff --git a/imap/src/c-client/mail.c b/imap/src/c-client/mail.c
index f3e14fe3..730201c2 100644
--- a/imap/src/c-client/mail.c
+++ b/imap/src/c-client/mail.c
@@ -1440,6 +1440,7 @@ MAILSTREAM *mail_close_full (MAILSTREAM *stream,long options)
if (stream->dtb) (*stream->dtb->close) (stream,options);
stream->dtb = NIL; /* resign driver */
if (stream->mailbox) fs_give ((void **) &stream->mailbox);
+ if (stream->auth.name) fs_give ((void **) &stream->auth.name);
if (stream->original_mailbox)
fs_give ((void **) &stream->original_mailbox);
if (stream->snarf.name) fs_give ((void **) &stream->snarf.name);
diff --git a/imap/src/c-client/oauth2_aux.c b/imap/src/c-client/oauth2_aux.c
index 4ab538c7..5af94992 100644
--- a/imap/src/c-client/oauth2_aux.c
+++ b/imap/src/c-client/oauth2_aux.c
@@ -425,8 +425,7 @@ void renew_accesstoken(MAILSTREAM *stream)
user[0] = '\0';
mm_login_method (&mb, user, (void *) &oauth2, trial, stream->auth.name);
- if(oauth2.param[OA2_State].value)
- fs_give((void **) &oauth2.param[OA2_State].value);
+ oauth2.param[OA2_State].value = NIL; /* this is freed before we get here */
if(stream->auth.expiration == 0){
stream->auth.expiration = oauth2.expiration;
@@ -447,4 +446,7 @@ void renew_accesstoken(MAILSTREAM *stream)
if(oauth2.param[OA2_Id].value) fs_give((void **) &oauth2.param[OA2_Id].value);
if(oauth2.param[OA2_Secret].value) fs_give((void **) &oauth2.param[OA2_Secret].value);
if(oauth2.param[OA2_Tenant].value) fs_give((void **) &oauth2.param[OA2_Tenant].value);
+ if(oauth2.param[OA2_State].value) fs_give((void **) &oauth2.param[OA2_State].value);
+ if(oauth2.param[OA2_RefreshToken].value) fs_give((void **) &oauth2.param[OA2_RefreshToken].value);
+ if(oauth2.access_token) fs_give((void **) &oauth2.access_token);
}