Skip to content

Commit 1b00254

Browse files
committed
call jwt_free
1 parent e5df258 commit 1b00254

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/ngx_http_auth_jwt_module.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static ngx_int_t ngx_http_auth_jwt_handler(ngx_http_request_t *r)
129129
char* return_url;
130130
ngx_http_auth_jwt_loc_conf_t *jwtcf;
131131
u_char *keyBinary;
132-
jwt_t *jwt;
132+
jwt_t *jwt = NULL;
133133
int jwtParseReturnCode;
134134
jwt_alg_t alg;
135135
const char* sub;
@@ -231,9 +231,17 @@ static ngx_int_t ngx_http_auth_jwt_handler(ngx_http_request_t *r)
231231
}
232232
}
233233

234+
jwt_free(jwt);
235+
234236
return NGX_OK;
235237

236238
redirect:
239+
240+
if (jwt)
241+
{
242+
jwt_free(jwt);
243+
}
244+
237245
r->headers_out.location = ngx_list_push(&r->headers_out.headers);
238246

239247
if (r->headers_out.location == NULL)

0 commit comments

Comments
 (0)