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

Commit0e033f5

Browse files
Fix a memory leak in dumping functions with TRANSFORMs
The gneration of the dump clause for functions with TRANSFORMcalls would leak the memory for holding the result of the Oidarray parsing. Fix by freeing.While in there, switch to using pg_malloc instead of palloc inorder to be consistent with the rest of the file.Author: Oleg Tselebrovskiy <o.tselebrovskiy@postgrespro.ru>Reviewed-by: Daniel Gustafsson <daniel@yesql.se>Discussion:https://postgr.es/m/baf1ae4511288e5b421f41e79a3df1a0@postgrespro.ru
1 parent9df2a4b commit0e033f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12531,7 +12531,7 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
1253112531

1253212532
if (*protrftypes)
1253312533
{
12534-
Oid *typeids =palloc(FUNC_MAX_ARGS * sizeof(Oid));
12534+
Oid *typeids =pg_malloc(FUNC_MAX_ARGS * sizeof(Oid));
1253512535
inti;
1253612536

1253712537
appendPQExpBufferStr(q, " TRANSFORM ");
@@ -12543,6 +12543,8 @@ dumpFunc(Archive *fout, const FuncInfo *finfo)
1254312543
appendPQExpBuffer(q, "FOR TYPE %s",
1254412544
getFormattedTypeName(fout, typeids[i], zeroAsNone));
1254512545
}
12546+
12547+
free(typeids);
1254612548
}
1254712549

1254812550
if (prokind[0] == PROKIND_WINDOW)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp