commit 6dd81fc

Santtu Lakkala  ·  2026-05-22 12:59:27 +0000 UTC
parent ed8d68f
Memory leak fix
1 files changed,  +2, -1
+2, -1
 1@@ -355,6 +355,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
 2     else
 3     if (strcmp(cmd, "/token") == 0) { /** **/
 4         xs *wrk = NULL;
 5+        xs *codewrk = NULL;
 6         const char *gtype = xs_dict_get(args, "grant_type");
 7         const char *code  = xs_dict_get(args, "code");
 8         const char *cid   = xs_dict_get(args, "client_id");
 9@@ -387,7 +388,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
10            I'm not sure of the impacts of this right now, but Subway Tooter does not
11            provide a code so one must be generated */
12         if (xs_is_null(code)){
13-            code = random_str();
14+            code = codewrk = random_str();
15         }
16         if (gtype && code && cid && csec && ruri) {
17             xs *app = app_get(cid);