[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 13/15] ui/cocoa: Fix the leak of qemu_console_get_label
|
From: |
Philippe Mathieu-Daudé |
|
Subject: |
[PATCH v6 13/15] ui/cocoa: Fix the leak of qemu_console_get_label |
|
Date: |
Tue, 15 Feb 2022 09:03:05 +0100 |
From: Akihiko Odaki <akihiko.odaki@gmail.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220213021329.2066-1-akihiko.odaki@gmail.com>
[PMD: Use g_autofree, suggested by Zoltan BALATON]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
ui/cocoa.m | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 6cadd43309..30702d31a5 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1678,7 +1678,9 @@ static void create_initial_menus(void)
/* Returns a name for a given console */
static NSString * getConsoleName(QemuConsole * console)
{
- return [NSString stringWithFormat: @"%s", qemu_console_get_label(console)];
+ g_autofree char *label = qemu_console_get_label(console);
+
+ return [NSString stringWithUTF8String:label];
}
/* Add an entry to the View menu for each console */
--
2.34.1
- [PATCH v6 05/15] hvf: Make hvf_get_segments() / hvf_put_segments() local, (continued)
- [PATCH v6 05/15] hvf: Make hvf_get_segments() / hvf_put_segments() local, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 04/15] hvf: Use standard CR0 and CR4 register definitions, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 06/15] hvf: Remove deprecated hv_vcpu_flush() calls, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 07/15] block/file-posix: Remove a deprecation warning on macOS 12, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 08/15] audio/coreaudio: Remove a deprecation warning on macOS 12, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 09/15] audio/dbus: Fix building with modules on macOS, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 10/15] ui/cocoa: Remove allowedFileTypes restriction in SavePanel, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 11/15] ui/cocoa: Add Services menu, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 12/15] ui/cocoa: Do not alert even without block devices, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 13/15] ui/cocoa: Fix the leak of qemu_console_get_label,
Philippe Mathieu-Daudé <=
- [PATCH v6 14/15] lcitool: Refresh, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 15/15] gitlab-ci: Support macOS 12 via cirrus-run, Philippe Mathieu-Daudé, 2022/02/15