Skip to content

Commit

Permalink
Merge pull request #343 from doublec/janssonrpc_double_free
Browse files Browse the repository at this point in the history
janssonrpc-c: Fix double free if retry timer add fails
  • Loading branch information
miconda committed Sep 24, 2015
2 parents b2ef89b + bce9cf9 commit 8cac414
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/janssonrpc-c/janssonrpc_request.c
Expand Up @@ -253,8 +253,6 @@ int schedule_retry(jsonrpc_request_t* req)

new_req->ntries = req->ntries;

free_request(req);

const struct timeval tv = ms_to_tv(time);

new_req->retry_ev = evtimer_new(global_ev_base, retry_cb, (void*)new_req);
Expand All @@ -264,6 +262,8 @@ int schedule_retry(jsonrpc_request_t* req)
goto error;
}

free_request(req);

return 0;
error:
ERR("schedule_retry failed.\n");
Expand Down

0 comments on commit 8cac414

Please sign in to comment.