On Tue, 2020-06-16 at 07:47 +0300, Aaro Altonen wrote:
- if (connpoint->sinks)
- {
for (i = 0; i < connpoint->sinks_size; ++i)
{
if (!connpoint->sinks[i])
break;
}
if (i == connpoint->sinks_size)
{
connpoint->sinks_size *= 2;
connpoint->sinks = heap_realloc_zero( connpoint->sinks,
connpoint->sinks_size * sizeof(*connpoint->sinks) );
You should check for allocation failure. Look at recordset.c:resize_fields for example.
}
- }
- else
- {
connpoint->sinks_size = 1;
connpoint->sinks = heap_alloc_zero( sizeof(*connpoint->sinks) );
And here.