Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit329de9f

Browse files
committed
Don't leak memory after connection aborts in pg_recvlogical.
Andres Freund, noticed by coverity.
1 parentc834576 commit329de9f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/bin/pg_basebackup/pg_recvlogical.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,6 @@ StreamLog(void)
547547
}
548548
PQclear(res);
549549

550-
if (copybuf!=NULL)
551-
PQfreemem(copybuf);
552-
553550
if (outfd!=-1&&strcmp(outfile,"-")!=0)
554551
{
555552
int64t=feGetCurrentTimestamp();
@@ -563,6 +560,11 @@ StreamLog(void)
563560
}
564561
outfd=-1;
565562
error:
563+
if (copybuf!=NULL)
564+
{
565+
PQfreemem(copybuf);
566+
copybuf=NULL;
567+
}
566568
destroyPQExpBuffer(query);
567569
PQfinish(conn);
568570
conn=NULL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp