Unverified Commit 53294e53 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Fix genClusterDebugString minor sds leaks (#12739)

This function now will only be called in printCrashReport,
so this is just a cleanup.
parent 0ffb9d2e
...@@ -1972,10 +1972,16 @@ void logStackTrace(void *eip, int uplevel) { ...@@ -1972,10 +1972,16 @@ void logStackTrace(void *eip, int uplevel) {
#endif /* HAVE_BACKTRACE */ #endif /* HAVE_BACKTRACE */
sds genClusterDebugString(sds infostring) { sds genClusterDebugString(sds infostring) {
sds cluster_info = genClusterInfoString();
sds cluster_nodes = clusterGenNodesDescription(NULL, 0, 0);
infostring = sdscatprintf(infostring, "\r\n# Cluster info\r\n"); infostring = sdscatprintf(infostring, "\r\n# Cluster info\r\n");
infostring = sdscatsds(infostring, genClusterInfoString()); infostring = sdscatsds(infostring, cluster_info);
infostring = sdscatprintf(infostring, "\n------ CLUSTER NODES OUTPUT ------\n"); infostring = sdscatprintf(infostring, "\n------ CLUSTER NODES OUTPUT ------\n");
infostring = sdscatsds(infostring, clusterGenNodesDescription(NULL, 0, 0)); infostring = sdscatsds(infostring, cluster_nodes);
sdsfree(cluster_info);
sdsfree(cluster_nodes);
return infostring; return infostring;
} }
......
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