mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00: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:
parent
4359900ed1
commit
2224989c39
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user