aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-09-04 12:33:58 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-09-04 12:33:58 -0400
commita2d75b67bccd24d17e328360080e4877d23bc369 (patch)
tree00ea7b2868a852fc7b8a10b0e026189afcfc95cd /src
parente21db14b8a6696a2b704b89df9c4be9cd0ea8a33 (diff)
downloadpostgresql-a2d75b67bccd24d17e328360080e4877d23bc369.tar.gz
postgresql-a2d75b67bccd24d17e328360080e4877d23bc369.zip
Remove useless pg_strdup() operations.
split_to_stringlist() doesn't modify its first argument nor expect it to remain valid after exit, so there's no need to duplicate the optarg string at the call sites. Per Coverity. (This has been wrong all along, but commit 052cc223d changed the useless calls from "strdup" to "pg_strdup", which apparently made Coverity think it's a new bug. It's not, but it's also not worth back-patching.)
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/pg_regress.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 22600578400..14c87c91abd 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -2064,7 +2064,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
* before we add the specified one.
*/
free_stringlist(&dblist);
- split_to_stringlist(pg_strdup(optarg), ", ", &dblist);
+ split_to_stringlist(optarg, ", ", &dblist);
break;
case 2:
debug = true;
@@ -2114,7 +2114,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
dlpath = pg_strdup(optarg);
break;
case 18:
- split_to_stringlist(pg_strdup(optarg), ", ", &extraroles);
+ split_to_stringlist(optarg, ", ", &extraroles);
break;
case 19:
add_stringlist_item(&temp_configs, optarg);