Message ID | 20231231051007.145823-1-m.belouarga@technologyandstrategy.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCIOR6FIYQJBBNPPYOWAMGQEWMVXC7Y@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=ZJlr73/s; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=drD0THJO; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13a; helo=mail-lf1-x13a.google.com; envelope-from=swupdate+bncbcior6fiyqjbbnppyowamgqewmvxc7y@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lf1-x13a.google.com (mail-lf1-x13a.google.com [IPv6:2a00:1450:4864:20::13a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T2nHg4FrHz20RF for <incoming@patchwork.ozlabs.org>; Sun, 31 Dec 2023 16:10:21 +1100 (AEDT) Received: by mail-lf1-x13a.google.com with SMTP id 2adb3069b0e04-50e7b20360bsf3664437e87.3 for <incoming@patchwork.ozlabs.org>; Sat, 30 Dec 2023 21:10:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703999414; cv=pass; d=google.com; s=arc-20160816; b=BjDKlJZIaQYEiETZH96g65jSjLeq77A1T8HG5q79qYkz9mcMnvqwVI0TjRfpcNk3qc f+kUzIjcbcxZ5Ppmr2+ICL+us5JZx4FDzFoFneCbmZt6NYNTdqV5nSbbN52XKSweMrDb NFuPrQGwaOScr89taEbtP8cXaodI1uNeVN25i7Pqt8AKyrPeYU3zdfemAIptU3YhhtIc niIwiBmnZbcgqn+d+iYgVFhxf+5sPRKo1RuaIKWpai0IoD+d85w+SH08KHNosdF3nSZm GmL/sqSDN+zYeb7ot3l70ryj0m9uNPI1VX6zu5ez+10YFyrdiFts4UBHoQTWdVR0Kyqt 1j+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature:dkim-signature; bh=eFqmj8B4Oo1mklq7+Uk/aTkK00xhQprczEU8VDPMFzU=; fh=a3VbWbiDpxqnmYDdgu1hrQI3rIX2E2gKqzRBEDNkKQU=; b=xDMgn95O2cmwH6oCsXpKi5cJ8mxHL50gLAEcd3VViihUfWvPeFxKXtgLPpOJrOvN5L e+p7b3nnHsaEextq020lJBeN17+KjUCaD+2KqmykieYTXaMT4BDcY37IlkWel5zApUz9 /rrbgI7JsCqKfwb4IkN+4gAIyjpp7KLn3U0ZkPOWJDBboS0HJH9TRP74qLbh2l6nYwK1 iis27J4Ww4HA5QZiI7slt48SMb9QFLIu1dsD/4axElc1im42I+CN7k5ocp8t57iTgFQg wMojDznEr9NSJ+RiTJpfGd0piknezNCV2J5pXMUDs4XLq/GFI/lVXxID/rhnGP+bQwQD kQ+Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DwScOPLi; spf=pass (google.com: domain of belouargamohamed@gmail.com designates 2a00:1450:4864:20::42c as permitted sender) smtp.mailfrom=belouargamohamed@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1703999414; x=1704604214; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=eFqmj8B4Oo1mklq7+Uk/aTkK00xhQprczEU8VDPMFzU=; b=ZJlr73/scVNAdLa37+oMV+CHVlbH7hQsy/rmxxwJYGHigJU6ETcPSWu7LaJADDk6c3 KkAie02ZU79gN9iT9iYXlyBsT2LX2VhE2FjxD7USdX/+toi4wz9FK2gKVGq/i17v1q3W iDr7D+Cl+o0Mz4/jtNeqK7LO5aIB4fgx9OpstmbgBG39M1bJ7xyzVjWqYHBs/iPIx5ya S8G0/DN+4ZtPlZim1ODtbfod8EKJTE7W1ABJ2nHAvSZBgxmU0OMf/T8Nwdto5SLVBics U5YchfkH7wBELTOzS0KKSrkeB4aECXt7CZq9Cxin8FQqPR2AOABnTSuTp7RHBMOLb03h mxiQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703999414; x=1704604214; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=eFqmj8B4Oo1mklq7+Uk/aTkK00xhQprczEU8VDPMFzU=; b=drD0THJOSNvUbwYRLTxwyhyLaD77uHaOkdw7vXY/Hj4gom/npjV9+OjcjbpPOake3U OMU2mR3DTJSAv0uoO3d+IJBRHPtd1oWu4PjaAC1wK745QQSeNTISV/1TosIFZJFiXC2l f3ItAmH313hJc9UpV1BDxxxet2DYvaEyp4OWXwTeca8zpRfbgQXkyUCdUgbJgyM4cfdR okrDwEBoX0eW6r4kPKWKIlj+ohtSyPexZ0rrZLfE72aT3DjmcEHG/wYk8W/mA7dakLE0 RUSAC87sRoX5QMX4Wq/IWyQTG50TwrgQp6RvaILfwjidyGFjJG1Mg6dcoD0xR1ctdvIx rTvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703999414; x=1704604214; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=eFqmj8B4Oo1mklq7+Uk/aTkK00xhQprczEU8VDPMFzU=; b=WnARWg+EUCPvozAZ/Zb99xAklDRE/mtz5WAOCcSu+VuRiAgZ2GgddT5qE215NlQxqd BaOsFeuhYO+buCk55CtW1vbRQtGYK37493OVa1tdA3WtSlTu82MbxgTITr5tYtBqY2Fe X0N9igFlkfxQwXSOxBu8biTMy8XmTSNlUmYTy+gDp4mrBInNudjN5xhez4EQ2g/Te+wt +wZV7bnwpezMzkCFJIJ52yfVplRWxbnLvDrc18N8N3r1zYRZuBNrjvkYefW+6V4DyfmC wdhwDVnB2tMNcDiZuhSDAnlubDeDKIgL4NTWxWdnz4c0ulO/a+X3WCig5i5vSZfoKPHR RzWg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOJu0YyAzWGTuQwbjQwuiyrd++65uray/0RmBdYUvfALq/7KFNDYLWan vpLm9i+PgjgUco3LTSd57T4= X-Google-Smtp-Source: AGHT+IE/XHjqUPW1tstWwpEtLPH4DpZGecAhU436m17k9mcrBWg+LpQmqEGEmub87YHdqn1U6yz0gQ== X-Received: by 2002:a19:6d1d:0:b0:50e:4942:3688 with SMTP id i29-20020a196d1d000000b0050e49423688mr5281530lfc.116.1703999413987; Sat, 30 Dec 2023 21:10:13 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6512:3b81:b0:50e:7bea:153a with SMTP id g1-20020a0565123b8100b0050e7bea153als231084lfv.2.-pod-prod-05-eu; Sat, 30 Dec 2023 21:10:12 -0800 (PST) X-Received: by 2002:a05:651c:1988:b0:2cd:2cd:9954 with SMTP id bx8-20020a05651c198800b002cd02cd9954mr36008ljb.32.1703999411790; Sat, 30 Dec 2023 21:10:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703999411; cv=none; d=google.com; s=arc-20160816; b=zEulVsyYfI/JAAC0taxxXfuDenSibbENWxzK74bmh/9PHxy+0iFfHqJjEbMuZmzx7c O7aWfD+NYl2RlTMZW1tPeE8/15YIXeotAP+KoqXPEgPd1LVftCc1zqNjE1ed+YHNMOta RfyhOqzfvMKBFUrpSiAxpJ99bzCTpBizuHxKt0jHY7Z3cmeXD+HhE2+DE1Zfa0/c+UJn 2nIpYFx7apHcljMtYrr6MwoEs33L0X3M9GCs+jJoMgt8fJVrCdrRSjtAjOej9EdGg2dn l0eYdq2ZfLW80ePUlewU/JbS+AWA1CvfUE6Z1rWA/zSEDzauPP31Qovzyy7aMwwAhH3g DLDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=NJcEjorkQFl4H0dL1ByOJTQgGQ7U4BeR5Jse+fVrSvI=; fh=a3VbWbiDpxqnmYDdgu1hrQI3rIX2E2gKqzRBEDNkKQU=; b=HaNH+Dey8VTBTLF8VEqXg55JCKuFO611RVncdGXXtiaLznxdWovhJjR0WRHTGEY6PE 8dP6meKag6BlgKZpP7KqCowzPQLxdiP71GHy4Ksh+Ow2nTGnzxgcBiW3DDCEjWXKxyva Vs0L1rKa+xijGKlVuxBwx7dh2/977GhfjsAVpdlsRrBPlXeonQWauQOlG9Rf/BLSS5XD Hx6D9XuD4yLlsAwK4eGMHrSIenzgrtGd+LyiN6WY/EA55ftrN01EbcGX2B7fSTz3lmxm HJM4Jf9qZMHzWqOzGAjGtNkXf2ZiEv1dbtSmyN0S4TxCZF+evMNKuKFn/tOt3esSo2LB lDBA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DwScOPLi; spf=pass (google.com: domain of belouargamohamed@gmail.com designates 2a00:1450:4864:20::42c as permitted sender) smtp.mailfrom=belouargamohamed@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com. [2a00:1450:4864:20::42c]) by gmr-mx.google.com with ESMTPS id v10-20020a2e960a000000b002ccf1919137si112280ljh.5.2023.12.30.21.10.11 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 30 Dec 2023 21:10:11 -0800 (PST) Received-SPF: pass (google.com: domain of belouargamohamed@gmail.com designates 2a00:1450:4864:20::42c as permitted sender) client-ip=2a00:1450:4864:20::42c; Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-336c8ab0b20so4589545f8f.1 for <swupdate@googlegroups.com>; Sat, 30 Dec 2023 21:10:11 -0800 (PST) X-Received: by 2002:a5d:4d0e:0:b0:333:2fd2:5d2e with SMTP id z14-20020a5d4d0e000000b003332fd25d2emr7088656wrt.96.1703999410169; Sat, 30 Dec 2023 21:10:10 -0800 (PST) Received: from localhost.localdomain ([79.93.180.101]) by smtp.gmail.com with ESMTPSA id d5-20020adffbc5000000b00336e69fbc32sm11391128wrs.102.2023.12.30.21.10.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 21:10:09 -0800 (PST) From: belouargamohamed@gmail.com To: swupdate@googlegroups.com Cc: f.lahoudere@technologyandstrategy.com, BELOUARGA Mohamed <m.belouarga@technologyandstrategy.com> Subject: [swupdate] [PATCH] Free pointer before exiting on error Date: Sun, 31 Dec 2023 06:10:07 +0100 Message-Id: <20231231051007.145823-1-m.belouarga@technologyandstrategy.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: belouargamohamed@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DwScOPLi; spf=pass (google.com: domain of belouargamohamed@gmail.com designates 2a00:1450:4864:20::42c as permitted sender) smtp.mailfrom=belouargamohamed@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
Free pointer before exiting on error
|
expand
|
Hi Mohamed, On 31.12.23 06:10, belouargamohamed@gmail.com wrote: > From: BELOUARGA Mohamed <m.belouarga@technologyandstrategy.com> > > When an error happend and the function cannot return the pointer dgst, > free it before quitting the function > > Signed-off-by: BELOUARGA Mohamed <m.belouarga@technologyandstrategy.com> > --- > corelib/swupdate_decrypt_pkcs11.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/corelib/swupdate_decrypt_pkcs11.c b/corelib/swupdate_decrypt_pkcs11.c > index 63672c5..b16d59e 100644 > --- a/corelib/swupdate_decrypt_pkcs11.c > +++ b/corelib/swupdate_decrypt_pkcs11.c > @@ -49,6 +49,7 @@ struct swupdate_digest *swupdate_DECRYPT_init(unsigned char *uri, > if (err) { > msg = p11_kit_uri_message(err); > ERROR("PKCS#11 URI: %s", msg); > + free(dgst); > return NULL; > } > Applied to -master, thanks ! Best regards, Stefano Babic
diff --git a/corelib/swupdate_decrypt_pkcs11.c b/corelib/swupdate_decrypt_pkcs11.c index 63672c5..b16d59e 100644 --- a/corelib/swupdate_decrypt_pkcs11.c +++ b/corelib/swupdate_decrypt_pkcs11.c @@ -49,6 +49,7 @@ struct swupdate_digest *swupdate_DECRYPT_init(unsigned char *uri, if (err) { msg = p11_kit_uri_message(err); ERROR("PKCS#11 URI: %s", msg); + free(dgst); return NULL; }