Commit 7229fa8d authored by antirez's avatar antirez
Browse files

Modules: fix memory leak in RM_IsModuleNameBusy().

parent 4d063bb6
...@@ -664,13 +664,9 @@ void RM_SetModuleAttribs(RedisModuleCtx *ctx, const char *name, int ver, int api ...@@ -664,13 +664,9 @@ void RM_SetModuleAttribs(RedisModuleCtx *ctx, const char *name, int ver, int api
* Otherwise zero is returned. */ * Otherwise zero is returned. */
int RM_IsModuleNameBusy(const char *name) { int RM_IsModuleNameBusy(const char *name) {
sds modulename = sdsnew(name); sds modulename = sdsnew(name);
dictEntry *de = dictFind(modules,modulename);
/* Check if the module name is busy. */
if (dictFind(modules,modulename) != NULL) {
sdsfree(modulename); sdsfree(modulename);
return 1; return de != NULL;
}
return 0;
} }
/* Return the current UNIX time in milliseconds. */ /* Return the current UNIX time in milliseconds. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment