From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Laurent Vivier Date: Wed, 6 Mar 2019 12:07:11 +0100 Message-Id: <20190306110711.309-11-laurent@vivier.eu> In-Reply-To: <20190306110711.309-1-laurent@vivier.eu> References: <20190306110711.309-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PULL 10/10] thunk: fix of malloc to g_new List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Riku Voipio , Zhang Chen , zhanghailiang , Christian Borntraeger , Cornelia Huck , Kevin Wolf , Richard Henderson , Thomas Huth , Igor Mammedov , Li Zhijian , John Snow , Halil Pasic , Pavel Dovgalyuk , Laurent Vivier , Eduardo Habkost , qemu-block@nongnu.org, Marcel Apfelbaum , Tony Krowiak , Max Reitz , "Michael S. Tsirkin" , qemu-trivial@nongnu.org, Laurent Vivier , Michael Tokarev , qemu-s390x@nongnu.org, Corey Minyard , Pierre Morel , Aarushi Mehta , Eric Blake , Stefan Hajnoczi 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); -- 2.20.1