diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-03-14 18:25:24 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-03-18 12:06:04 +0100 |
commit | a9fda24747321ab8bbd9f91d2ee6f2716c6d8d6b (patch) | |
tree | bc764af48018a0a9f8d5036ad6f1e388a8cde834 /ui | |
parent | a5489ae5bbd270f2a72b2179a9adf4089e3fb7b8 (diff) |
curses ui: add missing iconv_close calls
The iconv_t are opened but never closed.
Spotted by Coverity: CID 1399708
Spotted by Coverity: CID 1399709
Spotted by Coverity: CID 1399713
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-Id: <20190314172524.9290-1-samuel.thibault@ens-lyon.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/curses.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/curses.c b/ui/curses.c index 4ef9b9c677..cc6d6da684 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -519,6 +519,7 @@ static void font_setup(void) wchar_to_ucs_conv = iconv_open("UCS-2", "WCHAR_T"); if (wchar_to_ucs_conv == (iconv_t) -1) { + iconv_close(ucs_to_wchar_conv); fprintf(stderr, "Could not convert font glyphs to UCS-2: '%s'\n", strerror(errno)); exit(1); @@ -526,6 +527,8 @@ static void font_setup(void) font_conv = iconv_open("WCHAR_T", font_charset); if (font_conv == (iconv_t) -1) { + iconv_close(ucs_to_wchar_conv); + iconv_close(wchar_to_ucs_conv); fprintf(stderr, "Could not convert font glyphs from %s: '%s'\n", font_charset, strerror(errno)); exit(1); @@ -646,6 +649,9 @@ static void font_setup(void) } } } + iconv_close(ucs_to_wchar_conv); + iconv_close(wchar_to_ucs_conv); + iconv_close(font_conv); } static void curses_setup(void) |