]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Cleaned up initialization of client settings.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Mon, 11 Dec 2017 11:59:58 +0000 (12:59 +0100)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 11 Dec 2017 12:56:16 +0000 (14:56 +0200)
There were checks for the client context not being NULL, which makes no sense anymore, since a private context is always created when none is provided.
Problem reported by Coverity.

src/lib-http/http-client.c

index 561b7015c196e956b0cfed782f1b28f7353e298d..7bf58b317fff780ff0b85f23f6e0944796f20f73 100644 (file)
@@ -135,9 +135,8 @@ http_client_init_shared(struct http_client_context *cctx,
        }
 
        /* merge provided settings with context defaults */
-       i_assert(cctx != NULL || set != NULL);
        client->set = cctx->set;
-       if (cctx != NULL && set != NULL) {
+       if (set != NULL) {
                if (set->user_agent != NULL && *set->user_agent != '\0')
                        client->set.user_agent = p_strdup_empty(pool, set->user_agent);
                if (set->rawlog_dir != NULL && *set->rawlog_dir != '\0')