diff --git a/db/db.c b/db/db.c index 34f650dff88..9e1c12fd2ae 100644 --- a/db/db.c +++ b/db/db.c @@ -310,7 +310,8 @@ db_con_t* db_do_init(const str* url, void* (*new_connection)()) } if (!con->transfers) { - con->transfers = pkg_malloc(db_max_async_connections); + con->transfers = pkg_malloc(db_max_async_connections * + sizeof *con->transfers); if (!con->transfers) { LM_ERR("no more pkg\n"); goto err;