isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit c82397cf6e6c3c89b3b5bce6836bf17208abae70
parent 813ad67c5664019d198b5c0832c10142a20f2793
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Mon,  3 Aug 2020 12:39:33 +0200

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.

Diffstat:
Msrc/drv_proxy.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/drv_proxy.c b/src/drv_proxy.c @@ -306,9 +306,11 @@ proxy_set_bad_callback( store_t *gctx, void (*cb)( void *aux ), void *aux ) static void proxy_invoke_bad_callback( proxy_store_t *ctx ) { + ctx->ref_count++; debug( "%sCallback enter bad store\n", ctx->label ); 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