Explorar o código

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 %!s(int64=4) %!d(string=hai) anos
pai
achega
c82397cf6e
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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