Re: BUG #6672: Memory leaks in dumputils.c

Поиск
Список
Период
Сортировка
От Anna Zaks
Тема Re: BUG #6672: Memory leaks in dumputils.c
Дата
Msg-id CA+=xKSUav_nMDbQ8AFW=GDUPkoWSZyeUM1mWtk=30agWrF8_DQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #6672: Memory leaks in dumputils.c  (Josh Kupershmidt <schmiddy@gmail.com>)
Список pgsql-bugs
On Fri, Jun 1, 2012 at 11:13 AM, Josh Kupershmidt <schmiddy@gmail.com> wrot=
e:
> On Thu, May 31, 2012 at 10:06 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> zaks.anna@gmail.com writes:
>
>>> There are two memory leaks in dumputils (v9.2.0beta1):
>>
>>> 1)
>>> File: =A0 src/bin/scripts/dumputils.c
>>> Location: =A0 =A0 =A0 line 604, column 11
>>> Description: =A0 =A0Memory is never released; potential leak of memory
>>> pointed to by 'aclitems'
>>
>>> 2)
>>> File: =A0 src/bin/scripts/dumputils.c
>>> Location: =A0 =A0 =A0 line 793, column 10
>>> Description: =A0 =A0Memory is never released; potential leak of memory
>>> pointed to by 'eqpos'
>>
>> This is a remarkably unhelpful report. =A0I do not see any memory
>> allocation occurring on either line 604 or line 793 of dumputils.c,
>> in either 9.2beta1 or 9.1.3. =A0Could you perhaps provide source code
>> extracts rather than line numbers that reference indeterminate versions
>> of files?
>
> I suspect the first complaint is about this bit in git head's
> ./src/bin/pg_dump/dumputils.c:
>
> =A0 =A0 =A0 =A0if (!parseAclItem(aclitems[i], type, name, subname, remote=
Version,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0grantee, grantor, priv=
s, privswgo))
> =A0 =A0 =A0 =A0 =A0 =A0return false;
>
> since 'aclitems' isn't being freed before the return. And the second
> complaint seems to concern parseAclItem() not freeing 'buf' when it
> returns false. Both of these errors seem academic, since the callers
> of buildACLCommands() will bail out with exit_horribly() or
> exit_nicely() if it returns false. But IMO it's worth fixing anyway,
> to keep the compilers happy or in case of future code calling
> buildACLCommands() or parseAclItem().
>
> Attached is a patch to hopefully fix those two errors. I couldn't
> quite verify this fixes the OP's error messages, since "checker-266"
> isn't done running make after several hours on this OS X machine.
>

Josh,

What kid of machine are you using? Please, let me know how long it
took after it's done (It takes about one and a half hours on mine).

Thanks,
Anna.
> Josh

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Anna Zaks
Дата:
Сообщение: Re: BUG #6672: Memory leaks in dumputils.c
Следующее
От: Anna Zaks
Дата:
Сообщение: Re: BUG #6672: Memory leaks in dumputils.c