Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command. - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command.
Date
Msg-id CA+Tgmoa_0nHxNyXOMe6H_Cpwmdcp6_kGstkwOUDNLqo-qrPx3w@mail.gmail.com
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command.  (Kevin Hale Boyes <kcboyes@gmail.com>)
Responses Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command.  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Thu, Oct 3, 2013 at 6:38 PM, Kevin Hale Boyes <kcboyes@gmail.com> wrote:
> My C is very rusty but the traversal of SeqTableData doesn't seem correct.
> It saves the seqtab->next pointer into next, frees seqtab and then
> dereferences it.
> Shouldn't that last line be: seqtab = next?
>
> Kevin.
>
> +/*
> + * Flush cached sequence information.
> + */
> +void
> +ResetSequenceCaches(void)
> +{
> +   SeqTableData *next;
> +
> +   while (seqtab != NULL)
> +   {
> +       next = seqtab->next;
> +       free(seqtab);
> +       seqtab = seqtab->next;
> +   }

Oops, good catch.  Will fix, thanks.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: record identical operator
Next
From: Robert Haas
Date:
Subject: Re: GSOC13 proposal - extend RETURNING syntax