From 5661b190055b5feef3da0a211e316f57317f55aa Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Mon, 2 Dec 2019 19:17:35 +0200 Subject: [PATCH] fix crash in module short read test --- tests/modules/testrdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/modules/testrdb.c b/tests/modules/testrdb.c index 7c04bb4ef..3150b88e4 100644 --- a/tests/modules/testrdb.c +++ b/tests/modules/testrdb.c @@ -20,7 +20,8 @@ void *testrdb_type_load(RedisModuleIO *rdb, int encver) { long double ld = RedisModule_LoadLongDouble(rdb); if (RedisModule_IsIOError(rdb)) { RedisModuleCtx *ctx = RedisModule_GetContextFromIO(rdb); - RedisModule_FreeString(ctx, str); + if (str) + RedisModule_FreeString(ctx, str); return NULL; } /* Using the values only after checking for io errors. */