X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/ee789e157c767be9cbf90af5232bfeacc533e308..4b1f6ad3e7a5c7c28618e43e7539c9a937bf8521:/src/debug.c diff --git a/src/debug.c b/src/debug.c index e5686288..566b2b95 100644 --- a/src/debug.c +++ b/src/debug.c @@ -218,6 +218,10 @@ void computeDatasetDigest(unsigned char *final) { void debugCommand(redisClient *c) { if (!strcasecmp(c->argv[1]->ptr,"segfault")) { *((char*)-1) = 'x'; + } else if (!strcasecmp(c->argv[1]->ptr,"oom")) { + void *ptr = zmalloc(ULONG_MAX); /* Should trigger an out of memory. */ + zfree(ptr); + addReply(c,shared.ok); } else if (!strcasecmp(c->argv[1]->ptr,"assert")) { if (c->argc >= 3) c->argv[2] = tryObjectEncoding(c->argv[2]); redisAssertWithInfo(c,c->argv[0],1 == 2);