From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 9B26638582AB for ; Wed, 10 May 2023 12:55:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B26638582AB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683723348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lAumTxojaJON46TuYh2qu/lkGEFZuaHnJzg6JnYWnvU=; b=Gd2IavOuZXu6KnHHSgSAy2Q3oWepcECtgtvZdcpN3m2JZM4z5tECzm515IrWDQpw5lDbxq Q4MbvJITVQ5+MuOPSXb2k/DdByH4YtOoixvDzPoEkrWFNlTQiyXwZ2jR+kywHXzXcPEtoN RjxhrlMo4Z608PoyPe6gIh2ODh8rX3s= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-284-HrigTXqENCG84cXxNCuRLA-1; Wed, 10 May 2023 08:55:46 -0400 X-MC-Unique: HrigTXqENCG84cXxNCuRLA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 945CD3C397C4 for ; Wed, 10 May 2023 12:55:46 +0000 (UTC) Received: from oldenburg3.str.redhat.com (unknown [10.39.195.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD45D1410DD5; Wed, 10 May 2023 12:55:45 +0000 (UTC) From: Florian Weimer To: Joe Simmons-Talbott via Libc-alpha Cc: Joe Simmons-Talbott Subject: Re: [PATCH] vfprintf-internal: Replace alloca with malloc. References: <20230509174329.1959380-1-josimmon@redhat.com> Date: Wed, 10 May 2023 14:55:43 +0200 In-Reply-To: <20230509174329.1959380-1-josimmon@redhat.com> (Joe Simmons-Talbott via Libc-alpha's message of "Tue, 9 May 2023 13:43:29 -0400") Message-ID: <87bkisqrao.fsf@oldenburg3.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Joe Simmons-Talbott via Libc-alpha: > @@ -1334,6 +1338,13 @@ printf_positional (struct Xprintf_buffer * buf, const CHAR_T *format, > (specs[nspecs_done].next_fmt > - specs[nspecs_done].end_of_fmt)); > } > + if (malloced_pa_user) > + for (cnt = 0; cnt < nargs; ++cnt) > + { > + if (args_value[cnt].pa_user != NULL) > + free (args_value[cnt].pa_user); > + } > + > all_done: > scratch_buffer_free (&argsbuf); > scratch_buffer_free (&specsbuf); I think the deallocation code needs to come after the all_done: label, otherwise memory will leak on errors. Thanks, Florian