Thread (12 messages) 12 messages, 1 author, 2016-06-15
DORMANTno replies

Revision v1 of 3 in this series.

Revisions (3)
  1. v1 current
  2. v1 [diff vs current]
  3. v2 [diff vs current]

[PATCH 4/6] wt-status.c: fix a memleak

From: Stefan Beller <hidden>
Date: 2016-06-15 23:04:18
Subsystem: the rest · Maintainer: Linus Torvalds

In any code path of shorten_unambiguous_ref the return value is a
xstrdup(some string), so it is safe to free the variable `base`
in any codepath.

Signed-off-by: Stefan Beller <redacted>
---
 wt-status.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/wt-status.c b/wt-status.c
index 853419f..9d2a349 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1576,6 +1576,8 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
 
 	color_fprintf(s->fp, header_color, "]");
 	fputc(s->null_termination ? '\0' : '\n', s->fp);
+
+	free((char *)base);
 }
 
 void wt_shortstatus_print(struct wt_status *s)
-- 
2.3.0.81.gc37f363
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help