From patchwork Sat Sep 20 18:25:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yegor Yefremov X-Patchwork-Id: 4942271 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9A92FBEEA5 for ; Sat, 20 Sep 2014 18:25:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC03A201F5 for ; Sat, 20 Sep 2014 18:25:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12598201BB for ; Sat, 20 Sep 2014 18:25:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756926AbaITSZv (ORCPT ); Sat, 20 Sep 2014 14:25:51 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:53643 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756052AbaITSZu (ORCPT ); Sat, 20 Sep 2014 14:25:50 -0400 Received: by mail-wi0-f178.google.com with SMTP id z2so1010049wiv.17 for ; Sat, 20 Sep 2014 11:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OX3h6Fc/j9cmnX0EGAUhaO04DpNZNWWUArIvr0GYsH0=; b=qGtCC1EQCt7CO+xHURrRwxznAJyMlTWcaOqNVP0FFFKgRBBOYdcmTl/oA9TzN2sUZi VDHl3cACPWnTuN63TGcqSvaLwZ7dVkSnYJzEzrSXm/Wq7pjIYLxUsMQiCKjmOWZavMz9 GzrAUih6dZX2vVA2BdJG0C/TjDBXqDDbv1IO812oD2ebhEicfxecLigjppmh0XqN+y4a HfceUGJ97O69VPu1yW1iE7VMZT8kxbhUnNfwIhXT9cG2rXrvrKgsaqydYIljeN808bgF 2yayUxG0rBA791tv1g9XUM+8/Y97X96d+paqqX/hT3IPQJypr/hAvHFDcZouTtEjr6ds u2vg== X-Received: by 10.181.29.134 with SMTP id jw6mr4498927wid.69.1411237549080; Sat, 20 Sep 2014 11:25:49 -0700 (PDT) Received: from user-Lenovo-IdeaPad-Z500.localdomain (x2f08536.dyn.telefonica.de. [2.240.133.54]) by mx.google.com with ESMTPSA id ky3sm6332311wjb.39.2014.09.20.11.25.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Sep 2014 11:25:48 -0700 (PDT) From: Yegor Yefremov To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Yegor Yefremov Subject: [PATCH 2/2] iw: fix memory leak Date: Sat, 20 Sep 2014 20:25:25 +0200 Message-Id: <1411237525-5810-2-git-send-email-yegorslists@googlemail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1411237525-5810-1-git-send-email-yegorslists@googlemail.com> References: <1411237525-5810-1-git-send-email-yegorslists@googlemail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Close f, when returning before while loop. Signed-off-by: Yegor Yefremov --- coalesce.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coalesce.c b/coalesce.c index 0239915..0d80ceb 100644 --- a/coalesce.c +++ b/coalesce.c @@ -38,8 +38,10 @@ static int handle_coalesce_enable(struct nl80211_state *state, struct nl_cb *cb, return 1; nl_rules = nla_nest_start(msg, NL80211_ATTR_COALESCE_RULE); - if (!nl_rules) + if (!nl_rules) { + fclose(f); return -ENOBUFS; + } while (!feof(f)) { char *eol;