Skip to content

Commit

Permalink
Fix reference counting bug in stack.c
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Sustrik <[email protected]>
  • Loading branch information
sustrik committed Jul 15, 2018
1 parent e0a358b commit 8ffd14a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ void dill_freestack(void *stack) {
this very function can be still executing on that stack. */
if(ctx->count >= dill_max_cached_stacks) {
struct dill_slist *old = dill_slist_pop(&ctx->cache);
--ctx->count;
#if (HAVE_POSIX_MEMALIGN && HAVE_MPROTECT) & !defined DILL_NOGUARD
void *ptr = ((uint8_t*)(old + 1)) - dill_stack_size - dill_page_size();
int rc = mprotect(ptr, dill_page_size(), PROT_READ|PROT_WRITE);
Expand Down

0 comments on commit 8ffd14a

Please sign in to comment.