Skip to content

Commit

Permalink
clusterer sync: Fix several SHM leaks on error cases (Donor side)
Browse files Browse the repository at this point in the history
(cherry picked from commit 101396a)
  • Loading branch information
liviuchircu committed Oct 24, 2024
1 parent 0f86eeb commit 82645f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/clusterer/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void send_sync_repl(int sender, void *param)
if (!cap) {
LM_ERR("Sync request for unknown capability: %.*s\n",
p->cap_name.len, p->cap_name.s);
return;
goto out_free;
}

no_sync_chunks_sent = 0;
Expand Down Expand Up @@ -382,7 +382,7 @@ void send_sync_repl(int sender, void *param)
if (bin_init(&sync_end_pkt,&cl_extra_cap,CLUSTERER_SYNC_END,BIN_SYNC_VERSION,0)<0) {
LM_ERR("Failed to init bin packet\n");
lock_stop_read(cl_list_lock);
return;
goto out_free;
}
bin_push_str(&sync_end_pkt, &p->cap_name);
bin_push_int(&sync_end_pkt, no_sync_chunks_sent);
Expand All @@ -393,7 +393,7 @@ void send_sync_repl(int sender, void *param)
LM_ERR("Failed to send sync end message\n");
bin_free_packet(&sync_end_pkt);
lock_stop_read(cl_list_lock);
return;
goto out_free;
}

cluster_id = p->cluster->cluster_id;
Expand All @@ -403,7 +403,7 @@ void send_sync_repl(int sender, void *param)

LM_INFO("Sent all sync packets (%d) for capability '%.*s' to node %d, cluster "
"%d\n", pkt_no, p->cap_name.len, p->cap_name.s, p->node_id, cluster_id);

out_free:
shm_free(param);
}

Expand Down

0 comments on commit 82645f0

Please sign in to comment.