]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix build
authorMatthijs Mekking <matthijs@isc.org>
Tue, 4 Feb 2020 14:13:56 +0000 (15:13 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Wed, 5 Feb 2020 08:08:35 +0000 (09:08 +0100)
Restore cleanup: label in dns_client_startrequest because it still has one
goto for it.

lib/dns/client.c

index 945a7628a3ae03b9f3135c7036f926bb5ff0fe64..2d7827807dd5b98d01c3f3a2e1760b7cb39ea9c8 100644 (file)
@@ -1802,11 +1802,14 @@ dns_client_startrequest(dns_client_t *client, dns_message_t *qmessage,
 
        isc_refcount_decrement(&client->references);
 
-       LOCK(&client->lock);
-       ISC_LIST_UNLINK(client->reqctxs, ctx, link);
-       UNLOCK(&client->lock);
-       isc_mutex_destroy(&ctx->lock);
-       isc_mem_put(client->mctx, ctx, sizeof(*ctx));
+cleanup:
+       if (ctx != NULL) {
+               LOCK(&client->lock);
+               ISC_LIST_UNLINK(client->reqctxs, ctx, link);
+               UNLOCK(&client->lock);
+               isc_mutex_destroy(&ctx->lock);
+               isc_mem_put(client->mctx, ctx, sizeof(*ctx));
+       }
 
        isc_event_free(ISC_EVENT_PTR(&event));
        isc_task_detach(&tclone);