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

Commitc033569

Browse files
committed
Fix minor memory leak in pg_basebackup and pg_receivewal
The result of the query used to retrieve the WAL segment size from thebackend was not getting freed in two code paths. Both pg_basebackup andpg_receivewal exit immediately if a failure happened on this query, sothis was not an actual problem, but it could be an issue if this codegets used for other tools in different ways, be they future tools inthis code tree or external, existing, ones.Oversight in commitfc49e24, so backpatch down to 11.Author: Jie ZhangDiscussion:https://postgr.es/m/970ad9508461469b9450b64027842331@G08CNEXMBPEKD06.g08.fujitsu.localBackpatch-through: 11
1 parent687e566 commitc033569

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/bin/pg_basebackup/streamutil.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,12 @@ RetrieveWalSegSize(PGconn *conn)
315315
if (sscanf(PQgetvalue(res,0,0),"%d%s",&xlog_val,xlog_unit)!=2)
316316
{
317317
pg_log_error("WAL segment size could not be parsed");
318+
PQclear(res);
318319
return false;
319320
}
320321

322+
PQclear(res);
323+
321324
/* set the multiplier based on unit to convert xlog_val to bytes */
322325
if (strcmp(xlog_unit,"MB")==0)
323326
multiplier=1024*1024;
@@ -336,7 +339,6 @@ RetrieveWalSegSize(PGconn *conn)
336339
return false;
337340
}
338341

339-
PQclear(res);
340342
return true;
341343
}
342344

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp