From: Tom Rini Date: Thu, 13 Feb 2020 17:12:09 -0500 Subject: [PATCH] test: aes: fix memleak In-Reply-To: <1581005579-11826-1-git-send-email-philippe.reynes@softathome.com> References: <1581005579-11826-1-git-send-email-philippe.reynes@softathome.com> Message-ID: <20200213221209.GO18302@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Feb 06, 2020 at 05:12:59PM +0100, Philippe Reynes wrote: > In the first version, the result of malloc is checked > with ut_assertnonnull. But on a fail, this macro exit > the function, so previously malloc are not freed. > > So to avoid a memleak, we don't use ut_assertnonnull, > but simply check the return of malloc. If one has failed, > we freed all the allocated memory and quit the function. > > Reported-by: Coverity (CID: 284403) > Reported-by: Coverity (CID: 284404) > Reported-by: Coverity (CID: 284405) > Reported-by: Coverity (CID: 284406) > Reported-by: Coverity (CID: 284407) > Signed-off-by: Philippe Reynes Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: