Re: SetVariable

From: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Cc: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: SetVariable
Date: 2003-08-30 17:58:03
Message-ID: 000d01c36f20$42e95390$10d4a8c0@mm.eutelsat.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> Gaetano Mendola wrote:
> > "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> > > I see other strdup() calls that don't check on a return. Should we
deal
> > > with those too?
> >
> > Well strdup obtain the memory for the new string using a malloc
> > and normally is a good habit check the return value of a malloc.
>
> Right. My point is that we have lots of other strdup's in the code.
> Should we fix those too? Seems we should be consistent.

Of course yes, consider also that inside SetVariable the check is
performed but too late, after that the old value was loose for ever.

Keep also the suggestion of Tom Late about the xstrdup.

Regards
Gaetano Mendola

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gaetano Mendola 2003-08-30 18:07:49 Re: SetVariable
Previous Message Bruce Momjian 2003-08-30 17:47:19 Re: [HACKERS] What goes into the security doc?