don't crash in proxy_invoke_bad_callback()

we need to hold a ref to the proxy store, as after the bad_callback()
it's otherwise likely gone.
This commit is contained in:
Oswald Buddenhagen 2020-08-03 12:39:33 +02:00
parent 813ad67c56
commit c82397cf6e

View File

@ -306,9 +306,11 @@ proxy_set_bad_callback( store_t *gctx, void (*cb)( void *aux ), void *aux )
static void static void
proxy_invoke_bad_callback( proxy_store_t *ctx ) proxy_invoke_bad_callback( proxy_store_t *ctx )
{ {
ctx->ref_count++;
debug( "%sCallback enter bad store\n", ctx->label ); debug( "%sCallback enter bad store\n", ctx->label );
ctx->bad_callback( ctx->bad_callback_aux ); ctx->bad_callback( ctx->bad_callback_aux );
debug( "%sCallback leave bad store\n", ctx->label ); \ debug( "%sCallback leave bad store\n", ctx->label );
proxy_store_deref( ctx );
} }
//# EXCLUDE alloc_store //# EXCLUDE alloc_store