diff options
author | Eduardo Chappa <chappa@washington.edu> | 2018-06-01 21:18:28 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2018-06-01 21:18:28 -0600 |
commit | 992277048fb4c5f380edb8e9247b7e721662ca89 (patch) | |
tree | 1ce9ea3a402d53c0622992e3c569f5c84467292e /pico/composer.c | |
parent | bd4fcf866fa5b84c658852d5ec495ef5800313ef (diff) | |
download | alpine-992277048fb4c5f380edb8e9247b7e721662ca89.tar.xz |
* A few more modifications to make Valgrind happy.
Diffstat (limited to 'pico/composer.c')
-rw-r--r-- | pico/composer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/pico/composer.c b/pico/composer.c index b61d5dec..8c80c4a5 100644 --- a/pico/composer.c +++ b/pico/composer.c @@ -2864,8 +2864,10 @@ PaintHeader(int line, /* physical line on screen */ display_delimiter(ComposerEditing ? 0 : 1); - if(lastc) + if(lastc){ pico_set_colorp(lastc, PSC_NONE); + free_color_pair(&lastc); + } } @@ -3372,14 +3374,14 @@ display_delimiter(int state) UCS *bufp, *buf; COLOR_PAIR *lastc = NULL; + if(ComposerTopLine - 1 >= BOTTOM()) /* silently forget it */ + return; + if(Pmaster && Pmaster->colors){ lastc = pico_get_cur_color(); pico_set_colorp(Pmaster->colors->ntcp, PSC_NONE); } - if(ComposerTopLine - 1 >= BOTTOM()) /* silently forget it */ - return; - buf = utf8_to_ucs4_cpystr((gmode & MDHDRONLY) ? "" : HDR_DELIM); if(!buf) return; @@ -3393,6 +3395,7 @@ display_delimiter(int state) if(bufp[delim_ps] == '\0' && !(gmode & MDHDRONLY)){ delim_ps = state; fs_give((void **) &buf); + if(lastc) free_color_pair(&lastc); return; /* already displayed! */ } } @@ -3412,8 +3415,10 @@ display_delimiter(int state) peeol(); fs_give((void **) &buf); - if(lastc) + if(lastc){ pico_set_colorp(lastc, PSC_NONE); + free_color_pair(&lastc); + } } |