Browse Source

[Fix] Mempool: Fix alloc_array function to actually multiply nmembers by size

Found by: @citrin
tags/3.3
Vsevolod Stakhov 1 year ago
parent
commit
0049505d4f
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/libutil/mem_pool.c

+ 1
- 1
src/libutil/mem_pool.c View File

@@ -575,7 +575,7 @@ rspamd_mempool_alloc_array_ (rspamd_mempool_t * pool, gsize nmemb, gsize size,
nmemb, size);
g_abort();
}
return memory_pool_alloc_common (pool, size, alignment, RSPAMD_MEMPOOL_NORMAL, loc);
return memory_pool_alloc_common (pool, size * nmemb, alignment, RSPAMD_MEMPOOL_NORMAL, loc);
}

void *

Loading…
Cancel
Save