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. */
| 7311 | * context pointer 'ctx' only if the dictionary was created using the |
| 7312 | * context instead of passing NULL. */ |
| 7313 | void RM_FreeServerInfo(RedisModuleCtx *ctx, RedisModuleServerInfoData *data) { |
| 7314 | if (ctx != NULL) autoMemoryFreed(ctx,REDISMODULE_AM_INFO,data); |
| 7315 | raxIterator ri; |
| 7316 | raxStart(&ri,data->rax); |
| 7317 | while(1) { |
| 7318 | raxSeek(&ri,"^",NULL,0); |
| 7319 | if (!raxNext(&ri)) break; |
| 7320 | raxRemove(data->rax,(unsigned char*)ri.key,ri.key_len,NULL); |
| 7321 | sdsfree((sds)ri.data); |
| 7322 | } |
| 7323 | raxStop(&ri); |
| 7324 | raxFree(data->rax); |
| 7325 | zfree(data); |
| 7326 | } |
| 7327 | |
| 7328 | /* Get the value of a field from data collected with RM_GetServerInfo(). You |
| 7329 | * need to pass the context pointer 'ctx' only if you want to use auto memory |
no test coverage detected