I see a few malloc's in backend/access/transam/xlog.c that don't check
to see if malloc returns NULL/failure.  I think there should be at least
an Assert() in there.

Also, seems we use malloc() a few other places where palloc should be
used, like variable.c.  Is that correct?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Tue, 17 Dec 2002 13:30:21 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
malloc in xlog.c
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I see a few malloc's in backend/access/transam/xlog.c that don't check
> to see if malloc returns NULL/failure.  I think there should be at least
> an Assert() in there.

It'll dump core just fine without the help of an Assert ;-).  I don't
see that an Assert adds much of anything.

In practice those mallocs are done during startup, so it seems very
unlikely that they could fail, anyway.

> Also, seems we use malloc() a few other places where palloc should be
> used, like variable.c.  Is that correct?

Those are correct because of guc.c's conventions.  Note the comments.

			regards, tom lane

Tue, 17 Dec 2002 13:39:11 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: malloc in xlog.c 