1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-09 22:41:56 +03:00

Fix bogus size calculation introduced by commit cc5f81366.

The elements of RecordCacheArray are TupleDesc, not TupleDesc *.
Those are actually the same size, so that this error is harmless,
but it's still wrong --- and it might bite us someday, if TupleDesc
ever became a struct, say.

Per Coverity.
This commit is contained in:
Tom Lane
2017-09-17 11:35:27 -04:00
parent 936df5ba80
commit cad22075bc

View File

@ -1386,7 +1386,7 @@ ensure_record_cache_typmod_slot_exists(int32 typmod)
RecordCacheArray = (TupleDesc *) repalloc(RecordCacheArray,
newlen * sizeof(TupleDesc));
memset(RecordCacheArray + RecordCacheArrayLen, 0,
(newlen - RecordCacheArrayLen) * sizeof(TupleDesc *));
(newlen - RecordCacheArrayLen) * sizeof(TupleDesc));
RecordCacheArrayLen = newlen;
}
}