]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove duplicate variable initializations identified by clang static checker.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 30 Aug 2009 16:53:45 +0000 (16:53 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 30 Aug 2009 16:53:45 +0000 (16:53 +0000)
One of these represents a nontrivial bug (a promptly-leaked palloc), so
backpatch.

Greg Stark

src/backend/tsearch/regis.c
src/backend/tsearch/ts_parse.c
src/backend/utils/adt/encode.c

index 0fe0064fd1480545ed4f6ff76aa565802cdee732..9ba47531437c44089a6bd1b205b65bb0152d1bbe 100644 (file)
@@ -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;
index 9f12d66bf6e38a2f61b1449dad040a516641ff88..f77f5f22e893a110c2cc851962e4b1672c06df27 100644 (file)
@@ -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;
index 9219aa4f03caac77b9e23ce88ac48e83f0c0d8b1..5aef10d9ffd01f17b6d04efed4561b024c2e7334 100644 (file)
@@ -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;