X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/0b8441c1b2f69cba5dddfdd76a166e6ac5b2afb4..a6305f13d568858bf7a9246e4e457a3a90cd7837:/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);