From patchwork Wed Mar 6 11:07:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1052282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Drdz1CmWz9s9N for ; Wed, 6 Mar 2019 22:10:31 +1100 (AEDT) Received: from localhost ([127.0.0.1]:59298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1URQ-00069g-8P for incoming@patchwork.ozlabs.org; Wed, 06 Mar 2019 06:10:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1UPT-00054Z-E3 for qemu-devel@nongnu.org; Wed, 06 Mar 2019 06:08:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1UPS-0002Ir-GX for qemu-devel@nongnu.org; Wed, 06 Mar 2019 06:08:27 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:50005) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1UPQ-0002Be-4M; Wed, 06 Mar 2019 06:08:24 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MmDAc-1hRiOd0R96-00iAIv; Wed, 06 Mar 2019 12:07:43 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 6 Mar 2019 12:07:11 +0100 Message-Id: <20190306110711.309-11-laurent@vivier.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190306110711.309-1-laurent@vivier.eu> References: <20190306110711.309-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:ON5ZP15R6OYg6VTcqclWhyvlSDa7ZXb7fi8pmRnWMfe+21rMKa7 kK3YBDCnZrSW1Qel06ezhdzr9yWFI/Wl7i7ChTBxu4ZROr11eOEd6KeV10OyAei9iH1i6yD e1NvY/mTXIuj+fcEkY0efPBEw8FyE8YLNgl/hvWw47mOrCAC8BaaHwzM3D1vyzhyKOFd/Uw QOKwL9B0j2QFC5URxaTGQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:lnGteihNptM=:K1xmbRsqeZgjdyeI2f8zEg 0ZEP6WafoiDpZ45BM5JWC9nSVzIRt4NH1wMIUGk1l4JKcGQUgbDBzn0urHLLaEjZVDkLRe9Ti gjFizHkKMmRfcvFgrrgASpeZOGG2B9NhkE1i0TPWuc+GdLJ9KYE0Bvevo8BxeyNcjACjNZjYL 5nJTS38aAPfQtZftuYGY07aB3n9c5rTacACr1jnUCv+GvCpEx9w/GdPoLZySEc+XhxErGhssz igMHJKd9kCLuPqdVOYYsi0uiUFc5vZl5X2WzeLx1PmRRMGaY+1DQRKjpod4q8TtivZKnXM1jm 7eNxkdG7tAuuhDiLI9xI3BmfFKpOqOYGptrR+webIxayKcxX9QqgbTXdOmYjvs04i90RoK/fc ASXiXN7rWPwS1fJQ2jmJCWmjKBGQ4kz40Fb9FCXaeaHbmXNa1J1XIXNS1NjxjZ/uF+ztE7j4M wZKtZrCDu2VORq2dErQY4sZMgR1Zw5NMC+GmOituzO8TAtEjAuRbdEgOUkfnjNE/bY1cU1/Yu DhzS8gJXdIJd7skQ4qn0d9YlfDHsGvVSBECMK3w14cgwKizRP+6PyB2ng0zB/REbiTmoJXWxg ivCF1K+YPHDg4SlvOc7OsYKU4ncRAcJq/Ai6ddjVLjaz3nUKuLjuzJ6TE/ViVDjCgyVpD227v lzzAKrLV0szDqxQXc7PHNSZJ/UHrUwphSDYh1CmPPq9eyw/UfsRsRdgmG/njzJW35nOoDqcIK SeZJMOq7KJNpK15R3TcB9pwWYsihHiqrMgxbUA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.74 Subject: [Qemu-devel] [PULL 10/10] thunk: fix of malloc to g_new X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Hajnoczi , Li Zhijian , "Michael S. Tsirkin" , Michael Tokarev , Paolo Bonzini , zhanghailiang , qemu-block@nongnu.org, qemu-trivial@nongnu.org, Halil Pasic , Christian Borntraeger , Laurent Vivier , Tony Krowiak , Thomas Huth , Eduardo Habkost , Corey Minyard , Riku Voipio , qemu-s390x@nongnu.org, Pavel Dovgalyuk , Zhang Chen , John Snow , Aarushi Mehta , Richard Henderson , Kevin Wolf , Pierre Morel , Cornelia Huck , Laurent Vivier , Max Reitz , Igor Mammedov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Aarushi Mehta Note that since thunking occurs throughout the lifetime of the QEMU instance, there is no matching 'free' to correct. Signed-off-by: Aarushi Mehta Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Message-Id: <5310bd5d152fa36c1828a7cbd19fc893739d1609.camel@gmail.com> Signed-off-by: Laurent Vivier --- thunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thunk.c b/thunk.c index d5d8645cd4f1..17f3d320bb8e 100644 --- a/thunk.c +++ b/thunk.c @@ -89,7 +89,7 @@ void thunk_register_struct(int id, const char *name, const argtype *types) for(i = 0;i < 2; i++) { offset = 0; max_align = 1; - se->field_offsets[i] = malloc(nb_fields * sizeof(int)); + se->field_offsets[i] = g_new(int, nb_fields); type_ptr = se->field_types; for(j = 0;j < nb_fields; j++) { size = thunk_type_size(type_ptr, i);