Fix memory allocation for server databases (#1046)

Fix a bug in the way we allocate memory for the server databases
Introduced in #156.

Signed-off-by: Ran Shidlansik <ranshid@amazon.com>
This commit is contained in:
ranshid 2024-09-18 14:35:35 +03:00 committed by Madelyn Olson
parent 461a13ffc6
commit 3e83653afd

View File

@ -2636,7 +2636,7 @@ void initServer(void) {
serverLog(LL_WARNING, "Failed creating the event loop. Error message: '%s'", strerror(errno));
exit(1);
}
server.db = zmalloc(sizeof(server) * server.dbnum);
server.db = zmalloc(sizeof(serverDb) * server.dbnum);
/* Create the databases, and initialize other internal state. */
int slot_count_bits = 0;