MINOR: httpclient: destroy checks if a client was started but not stopped
During httpclient_destroy, add a condition in the BUG_ON which checks
that the client was started before it has ended. A httpclient structure
could have been created without being started.
diff --git a/src/http_client.c b/src/http_client.c
index 1eb3cd1..d0a1005 100644
--- a/src/http_client.c
+++ b/src/http_client.c
@@ -438,8 +438,8 @@
if (!hc)
return;
- /* we should never destroy a client which was not stopped */
- BUG_ON(!httpclient_ended(hc));
+ /* we should never destroy a client which was started but not stopped */
+ BUG_ON(httpclient_started(hc) && !httpclient_ended(hc));
/* request */
istfree(&hc->req.url);