X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=readline.c;h=d6e04d4796ccc5f1e3e7f4a7d2883bcfc004d1f3;hb=cd9234757528a1b7155a75ec2eedb375f71e99fa;hp=a0c9638e4d9634453964f9f3fcd581842f6685a9;hpb=fedf2de31023b4ee71a4e578db013976243a8143;p=qemu.git diff --git a/readline.c b/readline.c index a0c9638e4..d6e04d479 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; }