From: Tom Lane Date: Sun, 30 Aug 2009 16:53:31 +0000 (+0000) Subject: Remove duplicate variable initializations identified by clang static checker. X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=73a0d123e9023396b3e6dc15bbb7b2f85143a93f;p=users%2Fsimon%2Fpostgres.git Remove duplicate variable initializations identified by clang static checker. One of these represents a nontrivial bug (a promptly-leaked palloc), so backpatch. Greg Stark --- diff --git a/src/backend/tsearch/regis.c b/src/backend/tsearch/regis.c index 8980c2aec4..e492562a1e 100644 --- a/src/backend/tsearch/regis.c +++ b/src/backend/tsearch/regis.c @@ -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 f2440c43d0..c07488ed5f 100644 --- a/src/backend/tsearch/ts_parse.c +++ b/src/backend/tsearch/ts_parse.c @@ -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 b2042e78b0..1e144d952f 100644 --- a/src/backend/utils/adt/encode.c +++ b/src/backend/utils/adt/encode.c @@ -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;