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

Commit09f8421

Browse files
committed
pg_dump: Don't leak memory in buildDefaultACLCommands()
buildDefaultACLCommands() didn't destroy the string buffer created incertain cases, leading to a memory leak. Fix by destroying the bufferbefore returning from the function.Spotted by Coverity.Author: Michael PaquierBack-patch to 9.6 where buildDefaultACLCommands() was added.
1 parentaa5d3c0 commit09f8421

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/bin/pg_dump/dumputils.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,13 +390,19 @@ buildDefaultACLCommands(const char *type, const char *nspname,
390390
appendPQExpBuffer(sql,"SELECT pg_catalog.binary_upgrade_set_record_init_privs(true);\n");
391391
if (!buildACLCommands("",NULL,type,initacls,initracls,owner,
392392
prefix->data,remoteVersion,sql))
393+
{
394+
destroyPQExpBuffer(prefix);
393395
return false;
396+
}
394397
appendPQExpBuffer(sql,"SELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\n");
395398
}
396399

397400
if (!buildACLCommands("",NULL,type,acls,racls,owner,
398401
prefix->data,remoteVersion,sql))
402+
{
403+
destroyPQExpBuffer(prefix);
399404
return false;
405+
}
400406

401407
destroyPQExpBuffer(prefix);
402408

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp