Commit 6aa4c038 authored by Ondřej Surý's avatar Ondřej Surý

Merge branch 'scan-build-nits' into 'master'

Fixing clang-analyzer nits

See merge request !133
parents 824a7b3b 40844a4a
......@@ -214,15 +214,17 @@ struct tls_credentials * tls_get_ephemeral_credentials(struct engine *engine)
creds->ephemeral_servicename = strdup(engine_get_hostname(engine));
if (creds->ephemeral_servicename == NULL) {
kr_log_error("[tls] could not get server's hostname, using '" INVALID_HOSTNAME "' instead\n");
creds->ephemeral_servicename = strdup(INVALID_HOSTNAME);
if ((creds->ephemeral_servicename = strdup(INVALID_HOSTNAME)) == NULL) {
kr_log_error("[tls] failed to allocate memory for ephemeral credentials\n");
goto failure;
}
}
privkey = get_ephemeral_privkey();
if (!privkey)
if ((privkey = get_ephemeral_privkey()) == NULL) {
goto failure;
cert = get_ephemeral_cert(privkey, creds->ephemeral_servicename, now - 60*15, creds->valid_until);
if (!cert)
}
if ((cert = get_ephemeral_cert(privkey, creds->ephemeral_servicename, now - 60*15, creds->valid_until)) == NULL) {
goto failure;
}
if ((err = gnutls_certificate_set_x509_key(creds->credentials, &cert, 1, privkey)) < 0) {
kr_log_error("[tls] failed to set up ephemeral credentials\n");
goto failure;
......
......@@ -483,7 +483,6 @@ static int qr_task_send(struct qr_task *task, uv_handle_t *handle, struct sockad
}
}
/* Send using given protocol */
ret = 0;
if (handle->type == UV_UDP) {
uv_buf_t buf = { (char *)pkt->wire, pkt->size };
send_req->as.send.data = task;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment