Skip to content

Commit 3fbf307

Browse files
committed
Moves variable definition to avoid uninitialied use
1 parent a3d9b1d commit 3fbf307

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rejson.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,7 @@ int JSONArrIndex_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int
14701470
// validate path
14711471
JSONType_t *jt = RedisModule_ModuleTypeGetValue(key);
14721472
JSONPathNode_t *jpn = NULL;
1473+
Object *jo = NULL;
14731474
if (PARSE_OK != NodeFromJSONPath(jt->root, argv[2], &jpn)) {
14741475
ReplyWithSearchPathError(ctx, jpn);
14751476
goto error;
@@ -1496,7 +1497,6 @@ int JSONArrIndex_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int
14961497
}
14971498

14981499
// create an object from json
1499-
Object *jo = NULL;
15001500
char *jerr = NULL;
15011501
if (JSONOBJECT_OK != CreateNodeFromJSON(json, jsonlen, &jo, &jerr)) {
15021502
if (jerr) {

0 commit comments

Comments
 (0)