From nobody Thu Oct 31 23:48:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1592724660; cv=none; d=zohomail.com; s=zohoarc; b=JAwP8BfOr9wGgF9vwUEUR/VRAvTKPSEYr56/tjC+exLkchv0HVn0J5695YrvfE9AiBXAy7E1MBzruHzyEHMzxVYJVlT/Njsjx5dNWRAwwAyvBP2vvA91PsEB01nuWD+GGFgJxoZrYzFwHmL6bVx9qoWRp/4+9pqsotFLKimoL4w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592724660; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=LS2sbuWjMphSNaIZeeV/i7EyKQrAaA/i2Wv6ohOic9Q=; b=Kv5AhFr65l902aEhU9vGGx91Vok1EzFnw3sNDb/UoVo1bT8IguG2ocbGslplRKn32J5bVceD7yXXUQMZQJWfn9xOeYpaUwllfteskBUsOq78xz5qaZL0cefi71Hb59SzWWeJJz5AwO7hfScQmUHHeYK5+iMrmNs4pkpPCKsbrkA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592724660061464.9644884677168; Sun, 21 Jun 2020 00:31:00 -0700 (PDT) Received: from localhost ([::1]:36278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmuRN-0004IC-GZ for importer@patchew.org; Sun, 21 Jun 2020 03:30:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmtwz-0005A6-Kp for qemu-devel@nongnu.org; Sun, 21 Jun 2020 02:59:33 -0400 Received: from mxfz.ruijie.com.cn ([120.35.11.201]:14309 helo=FZEX3.ruijie.com.cn) by eggs.gnu.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jmtwv-0006Ig-BO for qemu-devel@nongnu.org; Sun, 21 Jun 2020 02:59:31 -0400 Received: from localhost.localdomain.localdomain (172.30.216.210) by FZEX3.ruijie.com.cn (192.168.58.89) with Microsoft SMTP Server id 14.3.123.3; Sun, 21 Jun 2020 14:53:07 +0800 From: lichun To: Subject: [PATCH] chardev/tcp: fix error message double free error Date: Sun, 21 Jun 2020 22:53:03 +0800 Message-ID: <20200621145303.13068-1-lichun@ruijie.com.cn> X-Mailer: git-send-email 2.18.4 MIME-Version: 1.0 X-Originating-IP: [172.30.216.210] Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=120.35.11.201; envelope-from=lichun@ruijie.com.cn; helo=FZEX3.ruijie.com.cn X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/21 02:53:10 X-ACL-Warn: Detected OS = Windows 7 or 8 [fuzzy] X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DATE_IN_FUTURE_06_12=1.947, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Mailman-Approved-At: Sun, 21 Jun 2020 03:29:40 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com, lichun , 706701795@qq.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: lichun --- chardev/char-socket.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index afebeec5c3..3b6c1c5848 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1086,7 +1086,10 @@ 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); + /* If connect_err_reported is true, it means err is already freed = */ + if (!s->connect_err_reported) { + error_free(err); + } goto cleanup; } =20 --=20 2.18.4