Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some missing unlocks #3893

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pjlib-util/src/pjlib-util/resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1840,15 +1840,15 @@ PJ_DEF(pj_status_t) pj_dns_resolver_add_entry( pj_dns_resolver *resolver,
pj_bzero(&key, sizeof(struct res_key));
if (pkt->hdr.anscount) {
/* Make sure name is not too long. */
PJ_ASSERT_RETURN(pkt->ans[0].name.slen < PJ_MAX_HOSTNAME,
PJ_ENAMETOOLONG);
PJ_ASSERT_ON_FAIL(pkt->ans[0].name.slen < PJ_MAX_HOSTNAME,
{ pj_grp_lock_release(resolver->grp_lock); return PJ_ENAMETOOLONG; });

init_res_key(&key, pkt->ans[0].type, &pkt->ans[0].name);

} else {
/* Make sure name is not too long. */
PJ_ASSERT_RETURN(pkt->q[0].name.slen < PJ_MAX_HOSTNAME,
PJ_ENAMETOOLONG);
PJ_ASSERT_ON_FAIL(pkt->q[0].name.slen < PJ_MAX_HOSTNAME,
{ pj_grp_lock_release(resolver->grp_lock); return PJ_ENAMETOOLONG; });

init_res_key(&key, pkt->q[0].type, &pkt->q[0].name);
}
Expand Down
1 change: 1 addition & 0 deletions pjlib/src/pj/ioqueue_winnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ PJ_DEF(pj_status_t) pj_ioqueue_destroy( pj_ioqueue_t *ioqueue )
}
#endif

pj_lock_release(ioqueue->lock);
if (ioqueue->auto_delete_lock)
pj_lock_destroy(ioqueue->lock);

Expand Down
1 change: 1 addition & 0 deletions pjlib/src/pj/pool_caching.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ static void cpool_release_pool( pj_pool_factory *pf, pj_pool_t *pool)
#if PJ_SAFE_POOL
/* Make sure pool is still in our used list */
if (pj_list_find_node(&cp->used_list, pool) != pool) {
pj_lock_release(cp->lock);
pj_assert(!"Attempt to destroy pool that has been destroyed before");
return;
}
Expand Down
4 changes: 3 additions & 1 deletion pjnath/src/pjnath/turn_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,9 @@ PJ_DEF(pj_status_t) pj_turn_session_set_server( pj_turn_session *sess,
unsigned i, cnt;

/* Default port must be specified */
PJ_ASSERT_RETURN(default_port>0 && default_port<65536, PJ_EINVAL);
PJ_ASSERT_ON_FAIL(default_port>0 && default_port<65536,
{status=PJ_EINVAL; goto on_return;});

sess->default_port = (pj_uint16_t)default_port;

cnt = PJ_TURN_MAX_DNS_SRV_CNT;
Expand Down
4 changes: 3 additions & 1 deletion pjsip/src/pjsip/sip_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,8 +1283,10 @@ PJ_DEF(pj_status_t) pjsip_transport_register( pjsip_tpmgr *mgr,
/* Allocate new entry for the freelist. */
for (; i < PJSIP_TRANSPORT_ENTRY_ALLOC_CNT; ++i) {
tp_add = PJ_POOL_ZALLOC_T(mgr->pool, transport);
if (!tp_add)
if (!tp_add){
pj_lock_release(mgr->lock);
return PJ_ENOMEM;
}
pj_list_init(tp_add);
pj_list_push_back(&mgr->tp_entry_freelist, tp_add);
}
Expand Down
Loading