Skip to content

Commit

Permalink
jsonrpc-c: fix crash at reconnect_cb if server was never connected
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed Jul 30, 2015
1 parent 459a323 commit 0588a7b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/jsonrpc-c/jsonrpc_io.c
Expand Up @@ -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);

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 0588a7b

Please sign in to comment.