Re: get_progname() should not be const char *?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Phil Sorber <phil(at)omniti(dot)com>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: get_progname() should not be const char *?
Date: 2013-02-05 03:52:37
Message-ID: 29286.1360036357@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Phil Sorber <phil(at)omniti(dot)com> writes:
> get_progname() returns a strdup()'d value. Shouldn't it then be simply
> char * and not const char *? Otherwise free() complains loudly without
> a cast.

I don't believe that callers should be trying to free() the result.
Whether it's been strdup'd or not is not any of their business.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-02-05 04:14:51 Re: pgsql: Stamp 9.1.8.
Previous Message Tom Lane 2013-02-05 03:50:20 Reminder to committers: we're done with 8.3 branch