From patchwork Sun Jul 25 12:58:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomer Barletz X-Patchwork-Id: 114128 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6PCwl2T006268 for ; Sun, 25 Jul 2010 12:58:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751307Ab0GYM6p (ORCPT ); Sun, 25 Jul 2010 08:58:45 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:56705 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751014Ab0GYM6p (ORCPT ); Sun, 25 Jul 2010 08:58:45 -0400 Received: by eya25 with SMTP id 25so320633eya.19 for ; Sun, 25 Jul 2010 05:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=uha7DOZwieQKzr4KEtpj3fx5iAxB6hb0PmCDOj4EAKE=; b=DTZ9iJkihoKOj/U67vi7HO24eDKRIa0T+pOoCFCufxJReQ//MdCH0dwdtjnTKQ89iM ET6n57X5l7jJbdYHEafeuxqzjHLqydzBW19irzRUHsXLE+vxAswSJUFNCw4mRW5t7ZZ1 f7Dx/lDd1RTV2Ql1pTDt89qpYsEmrmVSJByCM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=tDtr2f4qcOotpyz3aTZq+t9m9rPNNQgvE4trfEju4q41YDOnMEakJ70dTNDhY0Vbpx DAU74nfpilyuKSnSm15eqjX+hVA6ymnzoPnNg/SHxdEOgmSo/GobW3KFVHBEKr5mEbSS qichzscor593UZ5e+f4pM0YxVqmn2yJRHi+gc= MIME-Version: 1.0 Received: by 10.213.10.145 with SMTP id p17mr2314428ebp.17.1280062723807; Sun, 25 Jul 2010 05:58:43 -0700 (PDT) Received: by 10.14.22.73 with HTTP; Sun, 25 Jul 2010 05:58:43 -0700 (PDT) Date: Sun, 25 Jul 2010 15:58:43 +0300 Message-ID: Subject: [PATCH] Fix possible memory leak in dvbca.c From: Tomer Barletz To: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 25 Jul 2010 12:58:47 +0000 (UTC) diff -r d3509d6e9499 lib/libdvbapi/dvbca.c --- a/lib/libdvbapi/dvbca.c Sat Aug 08 19:17:21 2009 +0200 +++ b/lib/libdvbapi/dvbca.c Sun Jul 25 15:50:30 2010 +0300 @@ -110,8 +110,10 @@ if (buf == NULL) return -1; - if ((size = read(fd, buf, data_length+2)) < 2) + if ((size = read(fd, buf, data_length+2)) < 2) { + free(buf); return -1; + } *slot = buf[0]; *connection_id = buf[1];