Skip to content

Commit

Permalink
Fix genClusterDebugString minor sds leaks
Browse files Browse the repository at this point in the history
This function now will only be called in printCrashReport,
so this is just a cleanup.
  • Loading branch information
enjoy-binbin committed Nov 8, 2023
1 parent 0ffb9d2 commit c395c63
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1972,11 +1972,17 @@ void logStackTrace(void *eip, int uplevel) {
#endif /* HAVE_BACKTRACE */

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 = sdscatsds(infostring, genClusterInfoString());
infostring = sdscatsds(infostring, cluster_info);
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;
}

Expand Down

0 comments on commit c395c63

Please sign in to comment.