diff --git a/src/generator.c b/src/generator.c index 5d21ed03..33100bc6 100644 --- a/src/generator.c +++ b/src/generator.c @@ -2446,9 +2446,11 @@ static void delete_proxy(ckpool_t *ckp, gdata_t *gdata, proxy_instance_t *proxy) HASH_DELETE(sh, proxy->subproxies, subproxy); mutex_unlock(&proxy->proxy_lock); - send_stratifier_deadproxy(ckp, subproxy->id, subproxy->subid); - if (subproxy && proxy != subproxy) - store_proxy(gdata, subproxy); + if (subproxy) { + send_stratifier_deadproxy(ckp, subproxy->id, subproxy->subid); + if (proxy != subproxy) + store_proxy(gdata, subproxy); + } } while (subproxy); /* Recycle the proxy itself */