Skip to content

Commit 0994cfc

Browse files
alvherreibarwick
andcommitted
Don't uselessly escape a string that doesn't need escaping
Per gripe from Ian Barwick Co-authored-by: Ian Barwick <ian@2ndquadrant.com> Discussion: https://postgr.es/m/CABvVfJWNnNKb8cHsTLhkTsvL1+G6BVcV+57+w1JZ61p8YGPdWQ@mail.gmail.com
1 parent 8ab6608 commit 0994cfc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,9 +1716,9 @@ GenerateRecoveryConf(PGconn *conn)
17161716

17171717
if (replication_slot)
17181718
{
1719-
escaped = escape_quotes(replication_slot);
1720-
appendPQExpBuffer(recoveryconfcontents, "primary_slot_name = '%s'\n", replication_slot);
1721-
free(escaped);
1719+
/* unescaped: ReplicationSlotValidateName allows [a-z0-9_] only */
1720+
appendPQExpBuffer(recoveryconfcontents, "primary_slot_name = '%s'\n",
1721+
replication_slot);
17221722
}
17231723

17241724
if (PQExpBufferBroken(recoveryconfcontents) ||

0 commit comments

Comments
 (0)