diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-14 12:20:17 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-14 12:20:17 +0000 |
commit | 28544391f5b478d215131c7b1d63590f7338e692 (patch) | |
tree | 82a35c42ae7fd6311e31241b1d35746faa8ace88 /status.c | |
parent | 931b0103cda864466b7e357d298d2c4de0a7f5d5 (diff) | |
download | rtmux-28544391f5b478d215131c7b1d63590f7338e692.tar.gz rtmux-28544391f5b478d215131c7b1d63590f7338e692.tar.bz2 rtmux-28544391f5b478d215131c7b1d63590f7338e692.zip |
Do not leak formats in status_replace.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -503,7 +503,7 @@ status_replace(struct client *c, struct session *s, struct winlink *wl, struct window_pane *wp, const char *fmt, time_t t, int jobsflag) { static char out[BUFSIZ]; - char in[BUFSIZ], ch, *iptr, *optr; + char in[BUFSIZ], ch, *iptr, *optr, *expanded; size_t len; struct format_tree *ft; @@ -542,7 +542,9 @@ status_replace(struct client *c, struct session *s, struct winlink *wl, format_session(ft, s); format_winlink(ft, s, wl); format_window_pane(ft, wp); - return (format_expand(ft, out)); + expanded = format_expand(ft, out); + format_free(ft); + return (expanded); } /* Figure out job name and get its result, starting it off if necessary. */ |