mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user