From: Jeremy Harris Date: Thu, 14 Apr 2016 16:36:16 +0000 (+0100) Subject: Tidying: coverity issues X-Git-Tag: exim-4_88_RC1~116 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5f5be4927abaa906a25ffb295d48ee085894c388;p=exim.git Tidying: coverity issues --- diff --git a/src/src/acl.c b/src/src/acl.c index 0ab6292e1..474b0d181 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -1159,11 +1159,11 @@ uschar * fn_hdrs_added(void) { uschar * ret = NULL; +int size = 0; +int ptr = 0; header_line * h = acl_added_headers; uschar * s; uschar * cp; -int size = 0; -int ptr = 0; if (!h) return NULL; diff --git a/src/src/exim.c b/src/src/exim.c index 46e856b7a..490248917 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -1272,9 +1272,10 @@ for (i = 0;; i++) if (fn_readline != NULL) free(readline_line); #endif + /* yield can only be NULL if ss==p */ if (ss == p || yield[ptr-1] != '\\') { - yield[ptr] = 0; + if (yield) yield[ptr] = 0; break; } yield[--ptr] = 0; diff --git a/src/src/expand.c b/src/src/expand.c index 241916100..922519eb9 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -3851,8 +3851,8 @@ expand_string_internal(const uschar *string, BOOL ket_ends, const uschar **left, { int ptr = 0; int size = Ustrlen(string)+ 64; -int item_type; uschar *yield = store_get(size); +int item_type; const uschar *s = string; uschar *save_expand_nstring[EXPAND_MAXN+1]; int save_expand_nlength[EXPAND_MAXN+1]; diff --git a/src/src/lookups/pgsql.c b/src/src/lookups/pgsql.c index 53d17d7ad..735f85554 100644 --- a/src/src/lookups/pgsql.c +++ b/src/src/lookups/pgsql.c @@ -125,11 +125,11 @@ PGconn *pg_conn = NULL; PGresult *pg_result = NULL; int i; +uschar *result = NULL; int ssize = 0; int offset = 0; int yield = DEFER; unsigned int num_fields, num_tuples; -uschar *result = NULL; pgsql_connection *cn; uschar *server_copy = NULL; uschar *sdata[3];