[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH 10/11] qapi: Fix unchecked strdup() by converting
From: |
Markus Armbruster |
Subject: |
[Qemu-trivial] [PATCH 10/11] qapi: Fix unchecked strdup() by converting to g_strdup() |
Date: |
Wed, 16 Jan 2013 15:36:37 +0100 |
Note that we already free with g_free().
Signed-off-by: Markus Armbruster <address@hidden>
---
qapi/qmp-registry.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qapi/qmp-registry.c b/qapi/qmp-registry.c
index 70cdbca..28bbbe8 100644
--- a/qapi/qmp-registry.c
+++ b/qapi/qmp-registry.c
@@ -92,7 +92,7 @@ char **qmp_get_command_list(void)
list_head = list = g_malloc0(count * sizeof(char *));
QTAILQ_FOREACH(cmd, &qmp_commands, node) {
- *list = strdup(cmd->name);
+ *list = g_strdup(cmd->name);
list++;
}
--
1.7.11.7
- [Qemu-trivial] [PATCH 08/11] qemu-log: Plug trivial memory leak in cpu_set_log_filename(), (continued)
- [Qemu-trivial] [PATCH 01/11] g_malloc(0) and g_malloc0(0) return NULL; simplify, Markus Armbruster, 2013/01/16
- [Qemu-trivial] [PATCH 04/11] readline: Fix unchecked strdup() by converting to g_strdup(), Markus Armbruster, 2013/01/16
- Re: [Qemu-trivial] [Qemu-devel] [PATCH 00/11] Trivial memory allocation fixes & cleanups, Eric Blake, 2013/01/16
- [Qemu-trivial] [PATCH 06/11] virtfs-proxy-helper: Fix unchecked strdup() by conv. to g_strdup(), Markus Armbruster, 2013/01/16
- [Qemu-trivial] [PATCH 10/11] qapi: Fix unchecked strdup() by converting to g_strdup(),
Markus Armbruster <=