From patchwork Sat Dec 4 13:29:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: luigi.mantellini@idf-hit.com X-Patchwork-Id: 74263 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 1A855B70D4 for ; Sun, 5 Dec 2010 00:29:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 351A3281FF; Sat, 4 Dec 2010 14:29:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lVddzl+iGQKK; Sat, 4 Dec 2010 14:29:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8FD50281F4; Sat, 4 Dec 2010 14:29:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1306D281F3 for ; Sat, 4 Dec 2010 14:29:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HL4meM9ILIcO for ; Sat, 4 Dec 2010 14:29:23 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mx103.fabbricadigitale.it (mx2.fabbricadigitale.it [217.169.111.37]) by theia.denx.de (Postfix) with ESMTPS id 0986D281DA for ; Sat, 4 Dec 2010 14:29:22 +0100 (CET) Received: from localhost (mx103 [127.0.0.1]) by mx103.fabbricadigitale.it (MM4Csmtpd) with ESMTP id 9419FE0001FE for ; Sat, 4 Dec 2010 14:29:22 +0100 (CET) X-Virus-Scanned: amavisd-new at fabbricadigitale.it Received: from mx103.fabbricadigitale.it ([127.0.0.1]) by localhost (mx103.fabbricadigitale.it [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zXXuHLZa7U77 for ; Sat, 4 Dec 2010 14:29:22 +0100 (CET) Received: from EX02MailShare.fdmsha.local (unknown [172.16.26.10]) by mx103.fabbricadigitale.it (MM4Csmtpd) with ESMTPS id 81744E0001F4 for ; Sat, 4 Dec 2010 14:29:22 +0100 (CET) Received: from abel.dialface.net (85.40.213.226) by EX02MailShare.fdmsha.local (172.16.26.10) with Microsoft SMTP Server id 8.1.340.0; Sat, 4 Dec 2010 14:29:20 +0100 From: Luigi 'Comio' Mantellini To: Date: Sat, 4 Dec 2010 14:29:14 +0100 Message-ID: <1291469358-25023-3-git-send-email-luigi.mantellini@idf-hit.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1291469358-25023-1-git-send-email-luigi.mantellini@idf-hit.com> References: <1291469358-25023-1-git-send-email-luigi.mantellini@idf-hit.com> MIME-Version: 1.0 Cc: Luigi 'Comio' Mantellini Subject: [U-Boot] [PATCH 2/6 v2] LZMA: Avoid free on null pointer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Luigi 'Comio' Mantellini --- lib/lzma/LzmaDec.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/lib/lzma/LzmaDec.c b/lib/lzma/LzmaDec.c index f941da2..b2a3aec 100644 --- a/lib/lzma/LzmaDec.c +++ b/lib/lzma/LzmaDec.c @@ -913,7 +913,9 @@ SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *sr void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) { - alloc->Free(alloc, p->probs); + if (p->probs) { + alloc->Free(alloc, p->probs); + } p->probs = 0; }