From patchwork Mon Feb 1 09:56:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Dedecker X-Patchwork-Id: 576437 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6CCDB14031E for ; Mon, 1 Feb 2016 21:07:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=btQNATwz; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 9A82228BFDB; Mon, 1 Feb 2016 10:59:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C053B28BE79 for ; Mon, 1 Feb 2016 10:58:01 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 1 Feb 2016 10:57:57 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id l66so8280470wml.2 for ; Mon, 01 Feb 2016 01:57:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=arBZrzVzl1vdWvb6jfjTqgy0PHWUpSWJvER5NQ47amE=; b=btQNATwzb5OX14hZSHqy5BBHjHtLjPq9OPV4M0/U5uUpet7SRgEghmjsaAuNOX74f4 wTXqG9EHqdKVkAG1sYCB1/3nFKkRe3L1+KuKcp+a0lMnRTNTVei8zcC2toG8u/D/NBIE +KIF1IxA1n5WlHSifgmQRY6kHA6Yx8yK5ryFn5UxpEc52UTuaFSvBKu0l5U23baQNqY8 NdlkfhbUTxDN/HzkF/r7X8dJzulkESEzRnRPjSqeRASvBa0al1CBxOkCDHypDImj0dYo 06X/sJG3OByJKK3KacEH4xGP5mnSIS6MVT46RNzoSessiE10Yf6prpuPNFeYmSZp196w aBiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=arBZrzVzl1vdWvb6jfjTqgy0PHWUpSWJvER5NQ47amE=; b=DwvftLsnK6WbLC9KMT+6nf8zgEnqMjJkaFwNM1+lengXzLW5XOsco8uBEdOkPsskYK BrRLLfpyPw9RsT+0wUQcLpfu+BvfS37CGlFt2l/IZkuKDhAbBam0c3X4ZIMl9tc7DVYt BESkVFsWNLNvEnH2TUr3T0qhmtIgrhLBOg/eS0VOm/nsRSzfHWklNqo7Nd4mnJoKcO7T iHmr7/R+KIDwuuc2qmRx3imzlUp6RBDsV/NYPbJnfcYzHCd+igk1FQuecI4AYQ137I5+ IdTTqf4zjNilJam390DxMCmwYYb7vMOZwxuNQHzJLKx44FXzi8S5+X35YsbUiOQwsQzp APSg== X-Gm-Message-State: AG10YOS1WroBmBvFmLm6LRi4NsD7MQZGwv5uDGRL3/P0ePShM1DE+ctJBo9eOUEnrETzqQ== X-Received: by 10.28.194.69 with SMTP id s66mr11658999wmf.93.1454320664514; Mon, 01 Feb 2016 01:57:44 -0800 (PST) Received: from cplx43.eu.thmulti.com ([141.11.62.7]) by smtp.gmail.com with ESMTPSA id m67sm8118759wma.10.2016.02.01.01.57.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 01:57:43 -0800 (PST) From: Hans Dedecker To: openwrt-devel@lists.openwrt.org Date: Mon, 1 Feb 2016 10:56:27 +0100 Message-Id: <1454320590-20710-13-git-send-email-dedeckeh@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454320590-20710-1-git-send-email-dedeckeh@gmail.com> References: <1454320590-20710-1-git-send-email-dedeckeh@gmail.com> Cc: Hans Dedecker , cyrus@openwrt.org Subject: [OpenWrt-Devel] [PATCH netifd 13/16] system-linux: Fix memory leak X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Call globfree to free dynamically allocated storage from a previous glob call Signed-off-by: Hans Dedecker --- system-linux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system-linux.c b/system-linux.c index 909ba0f..9978ade 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1140,6 +1140,8 @@ system_if_set_rps_xps_val(const char *path, int val) snprintf(val_buf, sizeof(val_buf), "%x", val); for (i = 0; i < gl.gl_pathc; i++) system_set_sysctl(gl.gl_pathv[i], val_buf); + + globfree(&gl); } static void