Commit cad22075 authored by Tom Lane's avatar Tom Lane

Fix bogus size calculation introduced by commit cc5f8136.

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.
parent 936df5ba
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment