Browse Source

Fixed bug when if error occurred then requests is not freed and causing segfault on next error

master
Alexander Memer 1 year ago
parent
commit
550e3569c3
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      lib/rest.c

+ 2
- 0
lib/rest.c View File

@@ -19,6 +19,8 @@ void _ld_set_last_rest_error(struct ld_context *ctx, req_t *req)
json_error_t err;
json_t *res = json_loads(req->text, 0, &err);

requests_close(req);

if (!res)
{
log_error("failed to parse json at line %d: %s", err.line, err.text);

Loading…
Cancel
Save