Free data created with RM_GetServerInfo(). You need to pass the * context pointer 'ctx' only if the dictionary was created using the * context instead of passing NULL. */
| 7119 | * context pointer 'ctx' only if the dictionary was created using the |
| 7120 | * context instead of passing NULL. */ |
| 7121 | void RM_FreeServerInfo(RedisModuleCtx *ctx, RedisModuleServerInfoData *data) { |
| 7122 | if (ctx != NULL) autoMemoryFreed(ctx,REDISMODULE_AM_INFO,data); |
| 7123 | raxIterator ri; |
| 7124 | raxStart(&ri,data->rax); |
| 7125 | while(1) { |
| 7126 | raxSeek(&ri,"^",NULL,0); |
| 7127 | if (!raxNext(&ri)) break; |
| 7128 | raxRemove(data->rax,(unsigned char*)ri.key,ri.key_len,NULL); |
| 7129 | sdsfree(ri.data); |
| 7130 | } |
| 7131 | raxStop(&ri); |
| 7132 | raxFree(data->rax); |
| 7133 | zfree(data); |
| 7134 | } |
| 7135 | |
| 7136 | /* Get the value of a field from data collected with RM_GetServerInfo(). You |
| 7137 | * need to pass the context pointer 'ctx' only if you want to use auto memory |
no test coverage detected