From patchwork Fri Dec 19 13:18:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 422878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4702D14009B for ; Sat, 20 Dec 2014 00:19:32 +1100 (AEDT) Received: from localhost ([::1]:58493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1xSs-0004OB-Bc for incoming@patchwork.ozlabs.org; Fri, 19 Dec 2014 08:19:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1xS7-0002wn-N5 for qemu-devel@nongnu.org; Fri, 19 Dec 2014 08:18:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1xRz-0008Jy-NE for qemu-devel@nongnu.org; Fri, 19 Dec 2014 08:18:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1xRz-0008Jk-FH for qemu-devel@nongnu.org; Fri, 19 Dec 2014 08:18:35 -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 sBJDIWEw029947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Dec 2014 08:18:32 -0500 Received: from localhost (ovpn-112-69.ams2.redhat.com [10.36.112.69]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBJDIVhu026114; Fri, 19 Dec 2014 08:18:31 -0500 From: Stefan Hajnoczi To: Date: Fri, 19 Dec 2014 13:18:22 +0000 Message-Id: <1418995104-26262-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1418995104-26262-1-git-send-email-stefanha@redhat.com> References: <1418995104-26262-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: Peter Maydell , Markus Armbruster , Stefan Hajnoczi Subject: [Qemu-devel] [PULL 3/5] net: Fuse g_malloc(); memset() into g_new0() 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 Signed-off-by: Stefan Hajnoczi --- net/l2tpv3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/l2tpv3.c b/net/l2tpv3.c index 3b805a7..6014c43 100644 --- a/net/l2tpv3.c +++ b/net/l2tpv3.c @@ -695,8 +695,7 @@ int net_init_l2tpv3(const NetClientOptions *opts, goto outerr; } - s->dgram_dst = g_malloc(sizeof(struct sockaddr_storage)); - memset(s->dgram_dst, '\0' , sizeof(struct sockaddr_storage)); + s->dgram_dst = g_new0(struct sockaddr_storage, 1); memcpy(s->dgram_dst, result->ai_addr, result->ai_addrlen); s->dst_size = result->ai_addrlen;