"Mendola Gaetano" <mendola@bigfoot.com> writes:
> A test for null string is missing here:
> MemoryContextStrdup(MemoryContext context, const char *string)
> {
> char *nstr;
> -
> - if ( !string )
> - {
> - elog(ERROR, "MemoryContextStrdup called with a NULL pointer");
> - return NULL;
> - }
This seems inappropriate to me. Are you going to suggest that every
routine that takes a pointer parameter needs to explicitly test for
null? We could bloat the code a great deal that way, and slow it down,
without gaining anything at all in debuggability (IMHO anyway).
If there's a reason for pstrdup in particular to do this, what is it?
regards, tom lane