diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-08-30 16:53:45 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-08-30 16:53:45 +0000 |
commit | d40ef0dc0ba6fc66261aa73f08484369e5165e85 (patch) | |
tree | f8f4bcc1c8bf19edef06cea42836f35c31a73457 | |
parent | 143373bee58553fdc0d7c284aec69aecf0ec7ad0 (diff) | |
download | postgresql-d40ef0dc0ba6fc66261aa73f08484369e5165e85.tar.gz postgresql-d40ef0dc0ba6fc66261aa73f08484369e5165e85.zip |
Remove duplicate variable initializations identified by clang static checker.
One of these represents a nontrivial bug (a promptly-leaked palloc), so
backpatch.
Greg Stark
-rw-r--r-- | src/backend/tsearch/regis.c | 4 | ||||
-rw-r--r-- | src/backend/tsearch/ts_parse.c | 3 | ||||
-rw-r--r-- | 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 0fe0064fd14..9ba47531437 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.4 2008/01/21 02:46:10 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tsearch/regis.c,v 1.4.2.1 2009/08/30 16:53:45 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 9f12d66bf6e..f77f5f22e89 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.7.2.1 2009/01/15 17:06:03 teodor Exp $ + * $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.7.2.2 2009/08/30 16:53:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -102,7 +102,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 9219aa4f03c..5aef10d9ffd 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.20.2.1 2008/02/26 02:54:14 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/encode.c,v 1.20.2.2 2009/08/30 16:53:45 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; |