Module: kamailio
Branch: master
Commit: 8cac4148811a72385cdcbabf08be53390571cba2
URL:
https://github.com/kamailio/kamailio/commit/8cac4148811a72385cdcbabf08be533…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-09-24T08:52:22+02:00
Merge pull request #343 from doublec/janssonrpc_double_free
janssonrpc-c: Fix double free if retry timer add fails
---
Modified: modules/janssonrpc-c/janssonrpc_request.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8cac4148811a72385cdcbabf08be533…
Patch:
https://github.com/kamailio/kamailio/commit/8cac4148811a72385cdcbabf08be533…
---
diff --git a/modules/janssonrpc-c/janssonrpc_request.c
b/modules/janssonrpc-c/janssonrpc_request.c
index 39c7f31..f0117d9 100644
--- a/modules/janssonrpc-c/janssonrpc_request.c
+++ b/modules/janssonrpc-c/janssonrpc_request.c
@@ -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);
@@ -264,6 +262,8 @@ int schedule_retry(jsonrpc_request_t* req)
goto error;
}
+ free_request(req);
+
return 0;
error:
ERR("schedule_retry failed.\n");