diff --git a/window-customize.c b/window-customize.c index 71ca206fb..a31acc8ba 100644 --- a/window-customize.c +++ b/window-customize.c @@ -740,8 +740,10 @@ window_customize_draw_option(struct window_customize_modedata *data, if (strcmp(expanded, value) != 0) { if (!screen_write_text(ctx, cx, sx, sy - (s->cy - cy), 0, &grid_default_cell, "This expands to: %s", - expanded)) + expanded)) { + free(expanded); goto out; + } } free(expanded); }