Skip site navigation (1) Skip section navigation (2)

too many pfree in large object

From: t-ishii(at)sra(dot)co(dot)jp (Tatsuo Ishii)
To: hackers(at)postgreSQL(dot)org
Cc: t-ishii(at)sra(dot)co(dot)jp
Subject: too many pfree in large object
Date: 1998-10-03 14:30:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Hi, there's a small bug in inv_fetchup().
In the following do-while loop, res is freed at the very
end of the loop. However, after getting out of the loop,
it gets freed again. Not good. Possible fix would be
changing the pfree(res) in the loop to:

  if (tuple == (HeapTuple)NULL) pfree(res);

------------------- inv_api.c ----------------------
			res = index_getnext(obj_desc->iscan, ForwardScanDirection);

			if (res == (RetrieveIndexResult) NULL)
				return (HeapTuple) NULL;

			 * For time travel, we need to use the actual time qual here,
			 * rather that NowTimeQual.  We currently have no way to pass
			 * a time qual in.
			 * This is now valid for snapshot !!! And should be fixed in some
			 * way...	- vadim 07/28/98

			tuple = heap_fetch(obj_desc->heap_r, SnapshotNow,
							   &res->heap_iptr, buffer);
		} while (tuple == (HeapTuple) NULL);

		/* remember this tid -- we may need it for later reads/writes */
		ItemPointerCopy(&(res->heap_iptr), &(obj_desc->htid));
------------------- inv_api.c -----------------
Tatsuo Ishii


pgsql-hackers by date

Next:From: Bruce MomjianDate: 1998-10-03 14:54:15
Subject: Re: [COMMITTERS] 'pgsql/doc README.ipaddr'
Previous:From: Bruce MomjianDate: 1998-10-03 06:05:22
Subject: Open 6.4 items

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group