Module: kamailio
Branch: master
Commit: f2314469cba09e087f7e8092ba74790b62db36b3
URL:
https://github.com/kamailio/kamailio/commit/f2314469cba09e087f7e8092ba74790…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-07-30T20:51:50+02:00
Merge pull request #268 from kamailio/vseva/jsonrpc_fixes
jsonrpc-c: fix crash at reconnect_cb if server was never connected
---
Modified: modules/jsonrpc-c/jsonrpc_io.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f2314469cba09e087f7e8092ba74790…
Patch:
https://github.com/kamailio/kamailio/commit/f2314469cba09e087f7e8092ba74790…
---
diff --git a/modules/jsonrpc-c/jsonrpc_io.c b/modules/jsonrpc-c/jsonrpc_io.c
index 188d2e6..f001543 100644
--- a/modules/jsonrpc-c/jsonrpc_io.c
+++ b/modules/jsonrpc-c/jsonrpc_io.c
@@ -338,6 +338,7 @@ int parse_servers(char *_servers, struct jsonrpc_server_group
**group_ptr)
struct jsonrpc_server *server = pkg_malloc(sizeof(struct jsonrpc_server));
CHECK_MALLOC(server);
+ memset(server, 0, sizeof(struct jsonrpc_server));
char *h = pkg_malloc(strlen(host)+1);
CHECK_MALLOC(h);
@@ -365,6 +366,7 @@ int parse_servers(char *_servers, struct jsonrpc_server_group
**group_ptr)
selected_group = pkg_malloc(sizeof(struct jsonrpc_server_group));
CHECK_MALLOC(selected_group);
+ memset(selected_group, 0, sizeof(struct jsonrpc_server_group));
selected_group->priority = priority;
selected_group->next_server = server;