Skip to content

Commit ead2193

Browse files
committed
Fix for palloc(0) in new code
1 parent f5f366e commit ead2193

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/sort/psort.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.6 1997/08/06 03:41:55 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.7 1997/08/06 04:45:39 momjian Exp $
1111
*
1212
* NOTES
1313
* Sorts the first relation into the second relation.
@@ -570,7 +570,7 @@ dumptuples(Sort *node)
570570
HeapTuple tup;
571571
int memtupindex = 0;
572572

573-
if (! PS(node)->using_tape_files) {
573+
if (! PS(node)->using_tape_files && PS(node)->tupcount) {
574574
Assert(PS(node)->memtuples == NULL);
575575
PS(node)->memtuples = palloc(PS(node)->tupcount * sizeof(HeapTuple));
576576
}

0 commit comments

Comments
 (0)