Skip to content

Commit

Permalink
fix: memory leak on write filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Oct 19, 2024
1 parent b8e28df commit 2402fd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/net/filtering.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ z_result_t _z_write_filter_create(_z_publisher_t *pub) {

z_result_t _z_write_filter_destroy(_z_publisher_t *pub) {
if (pub->_filter.ctx != NULL) {
_Z_RETURN_IF_ERR(_z_remove_interest(_Z_RC_IN_VAL(&pub->_zn), pub->_filter._interest_id));
z_result_t res = _z_remove_interest(_Z_RC_IN_VAL(&pub->_zn), pub->_filter._interest_id);
z_free(pub->_filter.ctx);
pub->_filter.ctx = NULL;
return res;
}
return _Z_RES_OK;
}
Expand Down

0 comments on commit 2402fd2

Please sign in to comment.