"Bruce Momjian" <[EMAIL PROTECTED]> wrote:
> Mendola Gaetano wrote:
> > "Bruce Momjian" <[EMAIL PROTECTED]> wrote:
> > > Gaetano Mendola wrote:
> > > > "Bruce Momjian" <[EMAIL PROTECTED]> wrote:
> > > > > I see other strdup() calls that don't check on a return. Should
we
> > deal
> > > > > with th
Mendola Gaetano wrote:
> "Bruce Momjian" <[EMAIL PROTECTED]> wrote:
> > Gaetano Mendola wrote:
> > > "Bruce Momjian" <[EMAIL PROTECTED]> 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 th
"Bruce Momjian" <[EMAIL PROTECTED]> wrote:
> Gaetano Mendola wrote:
> > "Bruce Momjian" <[EMAIL PROTECTED]> 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 nor
"Tom Lane" <[EMAIL PROTECTED]> wrote:
> "Gaetano Mendola" <[EMAIL PROTECTED]> writes:
> > "Tom Lane" <[EMAIL PROTECTED]> wrote:
> >> strdup -> xstrdup if you're concerned.
>
> > May be is a good idea avoid the future use:
> > #define strdup STRDUP_DEPRECATED_USE_INSTEAD_XSTRDUP
>
> Not a good i
"Gaetano Mendola" <[EMAIL PROTECTED]> writes:
> "Tom Lane" <[EMAIL PROTECTED]> wrote:
>> strdup -> xstrdup if you're concerned.
> May be is a good idea avoid the future use:
> #define strdup STRDUP_DEPRECATED_USE_INSTEAD_XSTRDUP
Not a good idea --- there are places that want to check for strdup
"Tom Lane" <[EMAIL PROTECTED]> wrote:
> Bruce Momjian <[EMAIL PROTECTED]> writes:
> > I see other strdup() calls that don't check on a return. Should we deal
> > with those too?
>
> strdup -> xstrdup if you're concerned.
May be is a good idea avoid the future use:
#define strdup STRDUP_DEPRECA
"Bruce Momjian" <[EMAIL PROTECTED]> wrote:
> Gaetano Mendola wrote:
> > "Bruce Momjian" <[EMAIL PROTECTED]> 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 nor
Bruce Momjian <[EMAIL PROTECTED]> writes:
> I see other strdup() calls that don't check on a return. Should we deal
> with those too?
strdup -> xstrdup if you're concerned.
regards, tom lane
---(end of broadcast)---
TIP 6:
Gaetano Mendola wrote:
> "Bruce Momjian" <[EMAIL PROTECTED]> 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
"Bruce Momjian" <[EMAIL PROTECTED]> 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.
Regards
Gaetano Mendola
--
Mendola Gaetano wrote:
> Hi all,
> I found this code on the file variables.c and
> in the function SetVariable I read:
>
> if (strcmp(current->name, name) == 0)
> {
>free(current->value);
>current->value = strdup(value);
>return current->value ? true : f
Just a follow up,
is it better to give a patch for this kind of stuff ?
Regards
Gaetano Mendola
""Mendola Gaetano"" <[EMAIL PROTECTED]> wrote:
> Hi all,
> I found this code on the file variables.c and
> in the function SetVariable I read:
>
> if (strcmp(current->name, name) == 0)
> {
>
Hi all,
I found this code on the file variables.c and
in the function SetVariable I read:
if (strcmp(current->name, name) == 0)
{
free(current->value);
current->value = strdup(value);
return current->value ? true : false;
}
this mean that if there is no me
13 matches
Mail list logo