Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a2d75b6

Browse files
committed
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 052cc22 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.)
1 parent e21db14 commit a2d75b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/regress/pg_regress.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2064,7 +2064,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
20642064
* before we add the specified one.
20652065
*/
20662066
free_stringlist(&dblist);
2067-
split_to_stringlist(pg_strdup(optarg), ", ", &dblist);
2067+
split_to_stringlist(optarg, ", ", &dblist);
20682068
break;
20692069
case 2:
20702070
debug = true;
@@ -2114,7 +2114,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
21142114
dlpath = pg_strdup(optarg);
21152115
break;
21162116
case 18:
2117-
split_to_stringlist(pg_strdup(optarg), ", ", &extraroles);
2117+
split_to_stringlist(optarg, ", ", &extraroles);
21182118
break;
21192119
case 19:
21202120
add_stringlist_item(&temp_configs, optarg);

0 commit comments

Comments
 (0)