Skip to content

Commit df9bb26

Browse files
committed
Return -1 in the case of a failure to create the socket
1 parent 1d6496a commit df9bb26

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

modules/dispatcher/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ modparam("dispatcher", "partition",
769769
ping_sock = udp:public_ip:public_port")
770770

771771
modparam("dispatcher", "partition",
772-
"prioxies:
772+
"proxies:
773773
db_url = mysql://user:passwd@localhost/database;
774774
table_name = proxies;
775775
ping_sock = udp:private_ip:private_port")

modules/dispatcher/dispatcher.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,9 +769,10 @@ static int partition_init(ds_db_head_t *db_head, ds_partition_t *partition)
769769
}
770770

771771
if (db_head->ping_sock.s && db_head->ping_sock.len > 0) {
772-
if (pkg_str_dup(&partition->ping_sock, &db_head->ping_sock) < 0)
772+
if (pkg_str_dup(&partition->ping_sock, &db_head->ping_sock) < 0) {
773773
LM_ERR("cannot duplicate ping_sock\n");
774-
774+
return -1;
775+
}
775776
partition->ping_sock_info = parse_sock_info(&partition->ping_sock);
776777
if (partition->ping_sock_info==NULL) {
777778
LM_ERR("socket <%.*s> is not local to opensips (we must listen "

0 commit comments

Comments
 (0)