[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH v2 04/11] readline: Fix unchecked strdup() by conv
From: |
Markus Armbruster |
Subject: |
[Qemu-trivial] [PATCH v2 04/11] readline: Fix unchecked strdup() by converting to g_strdup() |
Date: |
Wed, 16 Jan 2013 18:32:13 +0100 |
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
readline.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/readline.c b/readline.c
index a0c9638..d6e04d4 100644
--- a/readline.c
+++ b/readline.c
@@ -247,14 +247,14 @@ static void readline_hist_add(ReadLineState *rs, const
char *cmdline)
}
if (idx == READLINE_MAX_CMDS) {
/* Need to get one free slot */
- free(rs->history[0]);
+ g_free(rs->history[0]);
memmove(rs->history, &rs->history[1],
(READLINE_MAX_CMDS - 1) * sizeof(char *));
rs->history[READLINE_MAX_CMDS - 1] = NULL;
idx = READLINE_MAX_CMDS - 1;
}
if (new_entry == NULL)
- new_entry = strdup(cmdline);
+ new_entry = g_strdup(cmdline);
rs->history[idx] = new_entry;
rs->hist_entry = -1;
}
--
1.7.11.7
[Qemu-trivial] [PATCH v2 05/11] spice: Fix unchecked strdup() by converting to g_strdup(), Markus Armbruster, 2013/01/16
[Qemu-trivial] [PATCH v2 04/11] readline: Fix unchecked strdup() by converting to g_strdup(),
Markus Armbruster <=
[Qemu-trivial] [PATCH v2 09/11] libcacard: Fix unchecked strdup() by converting to g_strdup(), Markus Armbruster, 2013/01/16
[Qemu-trivial] [PATCH v2 01/11] g_malloc(0) and g_malloc0(0) return NULL; simplify, Markus Armbruster, 2013/01/16
[Qemu-trivial] [PATCH v2 10/11] qapi: Fix unchecked strdup() by converting to g_strdup(), Markus Armbruster, 2013/01/16
[Qemu-trivial] [PATCH v2 08/11] qemu-log: Plug trivial memory leak in cpu_set_log_filename(), Markus Armbruster, 2013/01/16
[Qemu-trivial] [PATCH v2 06/11] virtfs-proxy-helper: Fix unchecked strdup() by conv. to g_strdup(), Markus Armbruster, 2013/01/16