Browse Source

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.
Oswald Buddenhagen 4 năm trước cách đây
mục cha
commit
c82397cf6e
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      src/drv_proxy.c

+ 3 - 1
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