[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 3/5] curses ui: add missing iconv_close calls
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 3/5] curses ui: add missing iconv_close calls |
Date: |
Mon, 18 Mar 2019 12:20:36 +0100 |
From: Samuel Thibault <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/curses.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/ui/curses.c b/ui/curses.c
index 4ef9b9c677ce..cc6d6da68463 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)
--
2.18.1
- [Qemu-devel] [PULL 0/5] Ui 20190318 patches, Gerd Hoffmann, 2019/03/18
- [Qemu-devel] [PULL 2/5] curses ui: always initialize all curses_line fields, Gerd Hoffmann, 2019/03/18
- [Qemu-devel] [PULL 4/5] keymaps: use nodeadkeys variant for de and fr, Gerd Hoffmann, 2019/03/18
- [Qemu-devel] [PULL 3/5] curses ui: add missing iconv_close calls,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 1/5] vnc: fix unalignment access in tight_pack24, Gerd Hoffmann, 2019/03/18
- [Qemu-devel] [PULL 5/5] keymaps: regenerate keymaps, Gerd Hoffmann, 2019/03/18
- Re: [Qemu-devel] [PULL 0/5] Ui 20190318 patches, Peter Maydell, 2019/03/18