]> granicus.if.org Git - postgresql/commitdiff
Remove duplicate variable initializations identified by clang static checker.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 30 Aug 2009 16:53:37 +0000 (16:53 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 30 Aug 2009 16:53:37 +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 4b71872dcf37fd81e7574a925b3d1c347f059f22..9a27ae21e892ac634018e9742bcc41c2b8af6d48 100644 (file)
@@ -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.7.2.1 2009/08/30 16:53:37 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 ccafe5f804ead9c74ab9c254d18ad9082873b6ad..cade59486757c60612fda00eeab46f46584712a7 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.12 2009/06/11 14:49:03 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.12.2.1 2009/08/30 16:53:37 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 480b85cefcbae4d197a0bfc6428f22bea035b051..41038b5fd8f167f2009f25ec0e272dbac3911422 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/encode.c,v 1.23 2009/01/01 17:23:49 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/encode.c,v 1.23.2.1 2009/08/30 16:53:37 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;