Skip to content

Commit

Permalink
Add a GC_GUARD for the reader stack in hiredis_read_internal
Browse files Browse the repository at this point in the history
Potential fix for #141

I suspect the reference isn't always kept on the stack, and GC triggering
at the wrong time may collect that object.
  • Loading branch information
byroot committed Sep 12, 2023
1 parent 4128571 commit 1ab081c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hiredis-client/ext/redis_client/hiredis/hiredis_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ static int hiredis_read_internal(hiredis_connection_t *connection, VALUE *reply)
*reply = (VALUE)redis_reply;
}

RB_GC_GUARD(reader_state.stack);

return 0;
}

Expand Down

0 comments on commit 1ab081c

Please sign in to comment.