Init all sample pointers when reusing loan
Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
9cf4b97f1a
commit
9b1920862e
3 changed files with 6 additions and 3 deletions
|
@ -42,7 +42,7 @@ static void sertopic_default_realloc_samples (void **ptrs, const struct ddsi_ser
|
|||
{
|
||||
const struct ddsi_sertopic_default *tp = (const struct ddsi_sertopic_default *)sertopic_common;
|
||||
const size_t size = tp->type->m_size;
|
||||
char *new = dds_realloc (old, size * count);
|
||||
char *new = (oldcount == count) ? old : dds_realloc (old, size * count);
|
||||
if (new && count > oldcount)
|
||||
memset (new + size * oldcount, 0, size * (count - oldcount));
|
||||
for (size_t i = 0; i < count; i++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue