From 1fafe7def15de73bd66271c9632584c456ea41e2 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 19 Jan 2018 09:52:34 +0100 Subject: [PATCH] CG: fix raxFind() retval check in streamCreateCG(). --- src/t_stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/t_stream.c b/src/t_stream.c index b9c0c4bd7..ffa5130d8 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -1076,7 +1076,8 @@ void streamConsumerFree(streamConsumer *sc) { * group is returned. */ streamCG *streamCreateCG(stream *s, char *name, size_t namelen, streamID id) { if (s->cgroups == NULL) s->cgroups = raxNew(); - if (raxFind(s->cgroups,(unsigned char*)name,namelen)) return NULL; + if (raxFind(s->cgroups,(unsigned char*)name,namelen) != raxNotFound) + return NULL; streamCG *cg = zmalloc(sizeof(*cg)); cg->pel = raxNew();