From patchwork Sat Dec 4 13:23:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,2/6,v2] LZMA: Avoid free on null pointer Date: Sat, 04 Dec 2010 03:23:46 -0000 From: luigi.mantellini@idf-hit.com X-Patchwork-Id: 74270 Message-Id: <1291469030-24984-3-git-send-email-luigi.mantellini@idf-hit.com> To: Cc: Luigi 'Comio' Mantellini From: Luigi 'Comio' Mantellini 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; }