Skip to content
Snippets Groups Projects
Commit 86455e1c authored by Marek Vavruša's avatar Marek Vavruša
Browse files

modules/stats: fixed potential crash on empty prefix

parent d9acf3c0
Branches
Tags
No related merge requests found
......@@ -264,7 +264,7 @@ static char* stats_list(void *env, struct kr_module *module, const char *args)
json_append_member(root, elm->key, json_mknumber(elm->val));
}
}
map_walk_prefixed(&data->map, args ? args : "", list_entry, root);
map_walk_prefixed(&data->map, (args_len > 0) ? args : "", list_entry, root);
char *ret = json_encode(root);
json_delete(root);
return ret;
......
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