Avoid free'ing a constant string in chardev lookup code

* src/qemu/qemu_monitor_text.c: Don't free const string in
   qemuMonitorTextGetPtyPaths()
This commit is contained in:
Daniel P. Berrange 2010-01-05 11:51:04 +00:00
parent 4359900ed1
commit 2224989c39

View File

@ -1678,14 +1678,12 @@ cleanup:
int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
virHashTablePtr paths)
{
const char *cmd = "info chardev";
char *reply = NULL;
int ret = -1;
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
_("failed to retrieve chardev info in qemu with '%s'"),
cmd);
if (qemuMonitorCommand(mon, "info chardev", &reply) < 0) {
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED, "%s",
_("failed to retrieve chardev info in qemu with 'info chardev'"));
goto cleanup;
}
@ -1747,7 +1745,6 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
ret = 0;
cleanup:
VIR_FREE(cmd);
VIR_FREE(reply);
return ret;
}