From e051e243953f0b976a1f24adf1b6a2f9f638314b Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 8 Feb 2022 16:58:39 +0100 Subject: [PATCH] Fix some scan-build warnings --- usual/json.c | 4 ++-- usual/tls/tls_client.c | 2 +- usual/tls/tls_ocsp.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usual/json.c b/usual/json.c index fce76402..bbde76b6 100644 --- a/usual/json.c +++ b/usual/json.c @@ -738,11 +738,11 @@ static bool parse_string(struct JsonContext *ctx, const char **src_p, const char static bool skip_comment(struct JsonContext *ctx, const char **src_p, const char *end) { - const char *s, *start; + const char *s; char c; size_t lnr; - s = start = *src_p; + s = *src_p; if (s >= end) return false; c = *s++; diff --git a/usual/tls/tls_client.c b/usual/tls/tls_client.c index 59dd19bb..4ebe2b39 100644 --- a/usual/tls/tls_client.c +++ b/usual/tls/tls_client.c @@ -68,7 +68,7 @@ tls_connect_servername(struct tls *ctx, const char *host, const char *port, * If port is NULL try to extract a port from the specified host, * otherwise use the default. */ - if ((p = (char *)port) == NULL) { + if (port == NULL) { ret = tls_host_port(host, &hs, &ps); if (ret == -1) { tls_set_errorx(ctx, "memory allocation failure"); diff --git a/usual/tls/tls_ocsp.c b/usual/tls/tls_ocsp.c index cf00429f..31a5cd8d 100644 --- a/usual/tls/tls_ocsp.c +++ b/usual/tls/tls_ocsp.c @@ -904,7 +904,7 @@ static int tls_ocsp_common_query(struct tls **ocsp_ctx_p, int *fd_p, struct tls_config *config, struct tls *target) { struct tls *ctx = NULL; - int ret, fd; + int ret, fd = -1; /* async path */ if (fd_p)