From dd6de24e69cbe0d5cf342905e3b0ee98365402e7 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 30 Aug 2009 16:53:31 +0000 Subject: [PATCH] Remove duplicate variable initializations identified by clang static checker. One of these represents a nontrivial bug (a promptly-leaked palloc), so backpatch. Greg Stark --- src/backend/tsearch/regis.c | 4 ++-- src/backend/tsearch/ts_parse.c | 3 +-- src/backend/utils/adt/encode.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/backend/tsearch/regis.c b/src/backend/tsearch/regis.c index 4b71872dcf..2639957ee5 100644 --- a/src/backend/tsearch/regis.c +++ b/src/backend/tsearch/regis.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tsearch/regis.c,v 1.7 2009/06/11 14:49:03 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/tsearch/regis.c,v 1.8 2009/08/30 16:53:31 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -182,7 +182,7 @@ RS_free(Regis *r) static bool mb_strchr(char *str, char *c) { - int clen = pg_mblen(c), + int clen, plen, i; char *ptr = str; diff --git a/src/backend/tsearch/ts_parse.c b/src/backend/tsearch/ts_parse.c index e895761836..676757c8f3 100644 --- a/src/backend/tsearch/ts_parse.c +++ b/src/backend/tsearch/ts_parse.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.14 2009/08/18 10:30:41 teodor Exp $ + * $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.15 2009/08/30 16:53:31 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -101,7 +101,6 @@ LexizeAddLemm(LexizeData *ld, int type, char *lemm, int lenlemm) { ParsedLex *newpl = (ParsedLex *) palloc(sizeof(ParsedLex)); - newpl = (ParsedLex *) palloc(sizeof(ParsedLex)); newpl->type = type; newpl->lemm = lemm; newpl->lenlemm = lenlemm; diff --git a/src/backend/utils/adt/encode.c b/src/backend/utils/adt/encode.c index e581e3bc42..c27daa27c2 100644 --- a/src/backend/utils/adt/encode.c +++ b/src/backend/utils/adt/encode.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/encode.c,v 1.24 2009/08/04 16:08:36 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/encode.c,v 1.25 2009/08/30 16:53:31 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -159,7 +159,7 @@ hex_decode(const char *src, unsigned len, char *dst) *srcend; char v1, v2, - *p = dst; + *p; srcend = src + len; s = src; -- 2.40.0