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

Commitd73b7f9

Browse files
committed
Fix memory leaks in failure paths in buildACLCommands and parseAclItem.
This is currently only cosmetic, since all the call sites just curl upand die in event of a failure return. It might be important for somefuture use-case, though, and in any case it quiets warnings from theclang static analyzer (as reported by Anna Zaks).Josh Kupershmidt
1 parent8fcbfea commitd73b7f9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/bin/pg_dump/dumputils.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,10 @@ buildACLCommands(const char *name, const char *subname,
600600
{
601601
if (!parseAclItem(aclitems[i],type,name,subname,remoteVersion,
602602
grantee,grantor,privs,privswgo))
603+
{
604+
free(aclitems);
603605
return false;
606+
}
604607

605608
if (grantor->len==0&&owner)
606609
printfPQExpBuffer(grantor,"%s",owner);
@@ -789,7 +792,10 @@ parseAclItem(const char *item, const char *type,
789792
/* user or group name is string up to = */
790793
eqpos=copyAclUserName(grantee,buf);
791794
if (*eqpos!='=')
795+
{
796+
free(buf);
792797
return false;
798+
}
793799

794800
/* grantor may be listed after / */
795801
slpos=strchr(eqpos+1,'/');
@@ -798,7 +804,10 @@ parseAclItem(const char *item, const char *type,
798804
*slpos++='\0';
799805
slpos=copyAclUserName(grantor,slpos);
800806
if (*slpos!='\0')
807+
{
808+
free(buf);
801809
return false;
810+
}
802811
}
803812
else
804813
resetPQExpBuffer(grantor);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp