From patchwork Thu Aug 15 19:13:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 11096335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DD4114DB for ; Thu, 15 Aug 2019 19:13:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36B1628928 for ; Thu, 15 Aug 2019 19:13:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B36D2892A; Thu, 15 Aug 2019 19:13:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C43628929 for ; Thu, 15 Aug 2019 19:13:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731220AbfHOTNW (ORCPT ); Thu, 15 Aug 2019 15:13:22 -0400 Received: from mail-pf1-f180.google.com ([209.85.210.180]:38987 "EHLO mail-pf1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730852AbfHOTNW (ORCPT ); Thu, 15 Aug 2019 15:13:22 -0400 Received: by mail-pf1-f180.google.com with SMTP id f17so1796435pfn.6 for ; Thu, 15 Aug 2019 12:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+QYEhlMTTXZjPGB4Thk1lTR0RHYYX9CeX4ucGOVNiAE=; b=opvAvLzN9RFkLqksajiAwzoqCn8zCYb39aAy6+3m+Uhc4BEFJEbPgNslM2I4r7+eBj ifI3xBN6o40Q/pQUIazwtLVwDBDVuSxSERLJ13xShSi1n9obSMrzJHR1WLbU/7rBCpIQ 2xp2YQ3oEjo12mp6W9hxsoCuVx7Btv0SPzmbmwr5oAChqjJz425enDznroe5BwZc5Vun aOXMyTOsErNtn0G+SGWd81QIApiJ2ltVjGQxy/Eg1osCbNj292D3R1JrT5/a0alekRXw LO076g55HU9LqfoppShod7Ski+QICSqEYrqcjsgpopv8qJmB23u3OlVmAphnByNMXf0L k9jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+QYEhlMTTXZjPGB4Thk1lTR0RHYYX9CeX4ucGOVNiAE=; b=HKCrmOC3j6+agbZ+PzNQy0puAz4zG0inGUbtNN1IU4nujC9BP/YkMz2DPBl5x2q++3 mcbJtDh2MCseiu19gj5ffEMfe+Na3IjLrezWf+OYqIO+49MuB35HjoiaswBkatAyxiB3 lQ10fwngMH5nPz1D/piuQ+i55RiumOwPak6oUkhM5wWkse1JA/CaG6juLNeD7kGKWsnr 4VL0fAak7q2y3MZAvj41ysv4clVIqJE0ToLCtrLXfS2bjzrXGbSm5ZNBgP7jc30lBTAk Jo2nwSdellq/ZvnhWoj+YTNhv6a+/LEf3iFMl4Y14LQrzNENy2r7iLhGBGgzY5bjHlrV cFAw== X-Gm-Message-State: APjAAAXu75JiHqE1HJ5oR0w780gBEWJqSqCaIXTpbObkr1mylRBDaolt kNgFK1saqILoq2HiueacscBRvxhpW+8= X-Google-Smtp-Source: APXvYqziVKSSvIhRpb5pv57+PPiojAyRi1ruGFBOih+Cd+1G085iDzaRB4uhHHir1xuKw0hiRGitqw== X-Received: by 2002:a63:4c21:: with SMTP id z33mr4692343pga.418.1565896401366; Thu, 15 Aug 2019 12:13:21 -0700 (PDT) Received: from localhost.localdomain ([205.209.24.227]) by smtp.gmail.com with ESMTPSA id a3sm3849109pfc.70.2019.08.15.12.13.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Aug 2019 12:13:21 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org Cc: Johannes.Schindelin@gmx.de, daniel@haxx.se, peff@peff.net Subject: [PATCH v2] http: use xmalloc with cURL Date: Thu, 15 Aug 2019 12:13:14 -0700 Message-Id: <20190815191314.27440-1-carenas@gmail.com> X-Mailer: git-send-email 2.23.0.rc2 In-Reply-To: <20190815153504.23199-1-carenas@gmail.com> References: <20190815153504.23199-1-carenas@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP f0ed8226c9 (Add custom memory allocator to MinGW and MacOS builds, 2009-05-31) never told cURL about it. Correct that by using the cURL initializer available since version 7.12 to point to xmalloc and friends for consistency which then will pass the allocation requests along when USE_NED_ALLOCATOR=YesPlease is used (most likely in Windows) Signed-off-by: Carlo Marcelo Arenas Belón --- Notes: v2: keep all global_init ifdefs together (as suggested by Junio) http.h | 4 ++++ 1 file changed, 4 insertions(+) base-commit: 9827d4c185e4da728f51cd77c54a38c9de62495f diff --git a/http.h b/http.h index b429f1cf04..20a2030c94 100644 --- a/http.h +++ b/http.h @@ -25,8 +25,12 @@ #if LIBCURL_VERSION_NUM < 0x070704 #define curl_global_cleanup() do { /* nothing */ } while (0) #endif + #if LIBCURL_VERSION_NUM < 0x070800 #define curl_global_init(a) do { /* nothing */ } while (0) +#elseif LIBCURL_VERSION_NUM >= 0x070c00 +#define curl_global_init(a) curl_global_init_mem(a, xmalloc, free, \ + xrealloc, xstrdup, xcalloc) #endif #if (LIBCURL_VERSION_NUM < 0x070c04) || (LIBCURL_VERSION_NUM == 0x071000)