memory: avoid leaking the filename when dottifying it on the minibar
This fixes https://savannah.gnu.org/bugs/?61334. Bug existed since version 5.5, since the minibar was introduced.master
parent
e51f6596d4
commit
7e807cdd2f
|
@ -2139,9 +2139,11 @@ void minibar(void)
|
||||||
* plus a star when the file has been modified. */
|
* plus a star when the file has been modified. */
|
||||||
if (COLS > 4) {
|
if (COLS > 4) {
|
||||||
if (namewidth > COLS - 2) {
|
if (namewidth > COLS - 2) {
|
||||||
thename = display_string(thename, namewidth - COLS + 5, COLS - 5, FALSE, FALSE);
|
char *shortname = display_string(thename, namewidth - COLS + 5,
|
||||||
|
COLS - 5, FALSE, FALSE);
|
||||||
mvwaddstr(bottomwin, 0, 0, "...");
|
mvwaddstr(bottomwin, 0, 0, "...");
|
||||||
waddstr(bottomwin, thename);
|
waddstr(bottomwin, shortname);
|
||||||
|
free(shortname);
|
||||||
} else
|
} else
|
||||||
mvwaddstr(bottomwin, 0, padding, thename);
|
mvwaddstr(bottomwin, 0, padding, thename);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue