Skip to content

Commit dd6de24

Browse files
committed
Remove duplicate variable initializations identified by clang static checker.
One of these represents a nontrivial bug (a promptly-leaked palloc), so backpatch. Greg Stark
1 parent e710b65 commit dd6de24

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/backend/tsearch/regis.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/tsearch/regis.c,v 1.7 2009/06/11 14:49:03 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/tsearch/regis.c,v 1.8 2009/08/30 16:53:31 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -182,7 +182,7 @@ RS_free(Regis *r)
182182
static bool
183183
mb_strchr(char *str, char *c)
184184
{
185-
int clen = pg_mblen(c),
185+
int clen,
186186
plen,
187187
i;
188188
char *ptr = str;

src/backend/tsearch/ts_parse.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.14 2009/08/18 10:30:41 teodor Exp $
10+
* $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.15 2009/08/30 16:53:31 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -101,7 +101,6 @@ LexizeAddLemm(LexizeData *ld, int type, char *lemm, int lenlemm)
101101
{
102102
ParsedLex *newpl = (ParsedLex *) palloc(sizeof(ParsedLex));
103103

104-
newpl = (ParsedLex *) palloc(sizeof(ParsedLex));
105104
newpl->type = type;
106105
newpl->lemm = lemm;
107106
newpl->lenlemm = lenlemm;

src/backend/utils/adt/encode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/encode.c,v 1.24 2009/08/04 16:08:36 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/encode.c,v 1.25 2009/08/30 16:53:31 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -159,7 +159,7 @@ hex_decode(const char *src, unsigned len, char *dst)
159159
*srcend;
160160
char v1,
161161
v2,
162-
*p = dst;
162+
*p;
163163

164164
srcend = src + len;
165165
s = src;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy