Merge pull request #4594 from smallstool/bugfix-freeMemoryIfneeded-int-overflow

fix int overflow problem in freeMemoryIfNeeded
This commit is contained in:
Salvatore Sanfilippo 2018-05-08 17:27:18 +02:00 committed by GitHub
commit aaef5f00cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -464,7 +464,7 @@ int freeMemoryIfNeeded(void) {
latencyStartMonitor(latency);
while (mem_freed < mem_tofree) {
int j, k, i, keys_freed = 0;
static int next_db = 0;
static unsigned int next_db = 0;
sds bestkey = NULL;
int bestdbid;
redisDb *db;