From 1751139117cc37f17051fdc55c0fe00c5da2043d Mon Sep 17 00:00:00 2001 From: antirez Date: Sat, 28 Nov 2009 16:55:05 +0100 Subject: [PATCH] Enabled object encoding for multiple keys in MSET. Added a test for memory leaks in test-redis.tcl when running on Mac OS X --- ae_kqueue.c | 3 +-- redis.c | 1 + test-redis.tcl | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ae_kqueue.c b/ae_kqueue.c index 1dc86af5..6408e322 100644 --- a/ae_kqueue.c +++ b/ae_kqueue.c @@ -84,7 +84,6 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) { eventLoop->fired[j].fd = e->ident; eventLoop->fired[j].mask = mask; } - } return numevents; -} \ No newline at end of file +} diff --git a/redis.c b/redis.c index dff33754..1236d9b5 100644 --- a/redis.c +++ b/redis.c @@ -3059,6 +3059,7 @@ static void msetGenericCommand(redisClient *c, int nx) { for (j = 1; j < c->argc; j += 2) { int retval; + tryObjectEncoding(c->argv[j+1]); retval = dictAdd(c->db->dict,c->argv[j],c->argv[j+1]); if (retval == DICT_ERR) { dictReplace(c->db->dict,c->argv[j],c->argv[j+1]); diff --git a/test-redis.tcl b/test-redis.tcl index a7acf641..00850c81 100644 --- a/test-redis.tcl +++ b/test-redis.tcl @@ -1092,6 +1092,14 @@ proc main {server port} { $r save } {OK} + catch { + if {[string match {*Darwin*} [exec uname -a]]} { + test {Check for memory leaks} { + exec leaks redis-server + } {*0 leaks*} + } + } + puts "\n[expr $::passed+$::failed] tests, $::passed passed, $::failed failed" if {$::failed > 0} { puts "\n*** WARNING!!! $::failed FAILED TESTS ***\n" -- 2.45.2