diff options
author | lichun <lichun@ruijie.com.cn> | 2020-06-22 05:30:17 +0800 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2020-09-02 19:06:19 -0500 |
commit | 54e74a45a58912dd7705d53e965e9092a0631aa5 (patch) | |
tree | 2d2c9e5d4b7b56615344a395c6f500977503bb86 | |
parent | 9380cb9de20b1554162eea9eb0e80209464ace50 (diff) | |
download | qemu-54e74a45a58912dd7705d53e965e9092a0631aa5.zip qemu-54e74a45a58912dd7705d53e965e9092a0631aa5.tar.gz qemu-54e74a45a58912dd7705d53e965e9092a0631aa5.tar.bz2 |
chardev/tcp: Fix error message double free error
Errors are already freed by error_report_err, so we only need to call
error_free when that function is not called.
Cc: qemu-stable@nongnu.org
Signed-off-by: lichun <lichun@ruijie.com.cn>
Message-Id: <20200621213017.17978-1-lichun@ruijie.com.cn>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Commit message improved, cc: qemu-stable]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
(cherry picked from commit ed4e0d2ef140aef255d67eec30767e5fcd949f58)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | chardev/char-socket.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/chardev/char-socket.c b/chardev/char-socket.c index e5ee685..5891787 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -142,6 +142,8 @@ static void check_report_connect_error(Chardev *chr, "Unable to connect character device %s: ", chr->label); s->connect_err_reported = true; + } else { + error_free(err); } qemu_chr_socket_restart_timer(chr); } @@ -1083,7 +1085,6 @@ static void qemu_chr_socket_connected(QIOTask *task, void *opaque) if (qio_task_propagate_error(task, &err)) { tcp_chr_change_state(s, TCP_CHARDEV_STATE_DISCONNECTED); check_report_connect_error(chr, err); - error_free(err); goto cleanup; } |