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

Commitef42c11

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 parent92b1522 commitef42c11

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
@@ -394,13 +394,19 @@ buildDefaultACLCommands(const char *type, const char *nspname,
394394
appendPQExpBuffer(sql,"SELECT pg_catalog.binary_upgrade_set_record_init_privs(true);\n");
395395
if (!buildACLCommands("",NULL,type,initacls,initracls,owner,
396396
prefix->data,remoteVersion,sql))
397+
{
398+
destroyPQExpBuffer(prefix);
397399
return false;
400+
}
398401
appendPQExpBuffer(sql,"SELECT pg_catalog.binary_upgrade_set_record_init_privs(false);\n");
399402
}
400403

401404
if (!buildACLCommands("",NULL,type,acls,racls,owner,
402405
prefix->data,remoteVersion,sql))
406+
{
407+
destroyPQExpBuffer(prefix);
403408
return false;
409+
}
404410

405411
destroyPQExpBuffer(prefix);
406412

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp