From patchwork Wed Jan 30 10:24:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 216830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 912B92C0096 for ; Wed, 30 Jan 2013 22:11:52 +1100 (EST) Received: from localhost ([::1]:57002 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0UrI-0002pU-Ow for incoming@patchwork.ozlabs.org; Wed, 30 Jan 2013 05:25:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0Uqz-0002Oh-Sm for qemu-devel@nongnu.org; Wed, 30 Jan 2013 05:25:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0Uqx-0003nN-Bu for qemu-devel@nongnu.org; Wed, 30 Jan 2013 05:25:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0Uqx-0003mX-49 for qemu-devel@nongnu.org; Wed, 30 Jan 2013 05:25:15 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0UAPEGg006793 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 30 Jan 2013 05:25:14 -0500 Received: from localhost (ovpn-112-21.ams2.redhat.com [10.36.112.21]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0UAP76C019816; Wed, 30 Jan 2013 05:25:08 -0500 From: Stefan Hajnoczi To: Date: Wed, 30 Jan 2013 11:24:21 +0100 Message-Id: <1359541470-30775-14-git-send-email-stefanha@redhat.com> In-Reply-To: <1359541470-30775-1-git-send-email-stefanha@redhat.com> References: <1359541470-30775-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori , Markus Armbruster , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 09/18] spice: Fix unchecked strdup() by converting to g_strdup() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Markus Armbruster Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Stefan Hajnoczi --- ui/spice-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index 3f2c565..bcc4199 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -848,8 +848,8 @@ static int qemu_spice_set_ticket(bool fail_if_conn, bool disconnect_if_conn) int qemu_spice_set_passwd(const char *passwd, bool fail_if_conn, bool disconnect_if_conn) { - free(auth_passwd); - auth_passwd = strdup(passwd); + g_free(auth_passwd); + auth_passwd = g_strdup(passwd); return qemu_spice_set_ticket(fail_if_conn, disconnect_if_conn); }