Skip to content

Commit

Permalink
Fix session mutex unlock on query reply (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc authored Jan 30, 2025
1 parent 48feb01 commit f1b548d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/session/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static z_result_t _z_trigger_query_reply_partial_inner(_z_session_t *zn, const _
// Cache most recent reply
pen_rep = (_z_pending_reply_t *)z_malloc(sizeof(_z_pending_reply_t));
if (pen_rep == NULL) {
_z_session_mutex_unlock(zn);
return _Z_ERR_SYSTEM_OUT_OF_MEMORY;
}
if (pen_qry->_consolidation == Z_CONSOLIDATION_MODE_MONOTONIC) {
Expand All @@ -166,7 +167,7 @@ static z_result_t _z_trigger_query_reply_partial_inner(_z_session_t *zn, const _
pen_rep->_reply.data._result.sample.keyexpr = _z_keyexpr_duplicate(&reply.data._result.sample.keyexpr);
} else {
// Copy the reply to store it out of context
_Z_RETURN_IF_ERR(_z_reply_copy(&pen_rep->_reply, &reply));
_Z_CLEAN_RETURN_IF_ERR(_z_reply_copy(&pen_rep->_reply, &reply), _z_session_mutex_unlock(zn));
}
pen_rep->_tstamp = _z_timestamp_duplicate(&msg->_commons._timestamp);
pen_qry->_pending_replies = _z_pending_reply_list_push(pen_qry->_pending_replies, pen_rep);
Expand Down

0 comments on commit f1b548d

Please sign in to comment.