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 GitHub
parent ba71c7e56e
commit 4593dc2f05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;