aboutsummaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authorSanttu Lakkala <inz@inz.fi>2026-05-22 15:59:27 +0300
committerSanttu Lakkala <santtu.lakkala@unikie.com>2026-05-22 16:00:39 +0300
commit6dd81fc9677a521fd7689126c5340ffe366b7a96 (patch)
treea1cab3455e28255f8d202848c9f2b20700a9c6cc /mastoapi.c
parented8d68fb4ff5f8ce78aa68b92afd5046024960a2 (diff)
Memory leak fix
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 1ddcdc4..1f4928e 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -355,6 +355,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
else
if (strcmp(cmd, "/token") == 0) { /** **/
xs *wrk = NULL;
+ xs *codewrk = NULL;
const char *gtype = xs_dict_get(args, "grant_type");
const char *code = xs_dict_get(args, "code");
const char *cid = xs_dict_get(args, "client_id");
@@ -387,7 +388,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
I'm not sure of the impacts of this right now, but Subway Tooter does not
provide a code so one must be generated */
if (xs_is_null(code)){
- code = random_str();
+ code = codewrk = random_str();
}
if (gtype && code && cid && csec && ruri) {
xs *app = app_get(cid);