From 6dd81fc9677a521fd7689126c5340ffe366b7a96 Mon Sep 17 00:00:00 2001 From: Santtu Lakkala Date: Fri, 22 May 2026 15:59:27 +0300 Subject: Memory leak fix --- mastoapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- cgit