diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c
new file mode 100644
index 623c250..13e6e1d
*** a/src/bin/pg_dump/dumputils.c
--- b/src/bin/pg_dump/dumputils.c
*************** buildACLCommands(const char *name, const
*** 599,606 ****
  	for (i = 0; i < naclitems; i++)
  	{
  		if (!parseAclItem(aclitems[i], type, name, subname, remoteVersion,
! 						  grantee, grantor, privs, privswgo))
  			return false;
  
  		if (grantor->len == 0 && owner)
  			printfPQExpBuffer(grantor, "%s", owner);
--- 599,608 ----
  	for (i = 0; i < naclitems; i++)
  	{
  		if (!parseAclItem(aclitems[i], type, name, subname, remoteVersion,
! 						  grantee, grantor, privs, privswgo)) {
! 			free(aclitems);
  			return false;
+ 		}
  
  		if (grantor->len == 0 && owner)
  			printfPQExpBuffer(grantor, "%s", owner);
*************** parseAclItem(const char *item, const cha
*** 788,795 ****
  
  	/* user or group name is string up to = */
  	eqpos = copyAclUserName(grantee, buf);
! 	if (*eqpos != '=')
  		return false;
  
  	/* grantor may be listed after / */
  	slpos = strchr(eqpos + 1, '/');
--- 790,799 ----
  
  	/* user or group name is string up to = */
  	eqpos = copyAclUserName(grantee, buf);
! 	if (*eqpos != '=') {
! 		free(buf);
  		return false;
+ 	}
  
  	/* grantor may be listed after / */
  	slpos = strchr(eqpos + 1, '/');
*************** parseAclItem(const char *item, const cha
*** 797,804 ****
  	{
  		*slpos++ = '\0';
  		slpos = copyAclUserName(grantor, slpos);
! 		if (*slpos != '\0')
  			return false;
  	}
  	else
  		resetPQExpBuffer(grantor);
--- 801,810 ----
  	{
  		*slpos++ = '\0';
  		slpos = copyAclUserName(grantor, slpos);
! 		if (*slpos != '\0') {
! 			free(buf);
  			return false;
+ 		}
  	}
  	else
  		resetPQExpBuffer(grantor);
