summaryrefslogtreecommitdiff
path: root/imap/src/c-client/oauth2_aux.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2021-08-23 21:16:46 -0600
committerEduardo Chappa <chappa@washington.edu>2021-08-23 21:16:46 -0600
commit8961761e0b3c7b3cc11a00f6ac6ebf7a29bc5a10 (patch)
tree277ebcf5150a1950dbd4deacb82cd89fbd9ce83f /imap/src/c-client/oauth2_aux.c
parente9b3f2043f7d309ecc58b907ff17d561ff972698 (diff)
downloadalpine-8961761e0b3c7b3cc11a00f6ac6ebf7a29bc5a10.tar.xz
* Fix some memory leaks reported by Valgrind.
Diffstat (limited to 'imap/src/c-client/oauth2_aux.c')
-rw-r--r--imap/src/c-client/oauth2_aux.c6
1 files changed, 4 insertions, 2 deletions
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);
}