Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1388952pxb; Fri, 20 Aug 2021 04:37:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG9p3YID57fHzNRMsX1Dpa24OQwh7KPt7kurg80HSQy696Do058IwkTmLY+4EdX8WmPqBh X-Received: by 2002:a17:906:b09:: with SMTP id u9mr20642386ejg.496.1629459447460; Fri, 20 Aug 2021 04:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629459447; cv=none; d=google.com; s=arc-20160816; b=Jik1zB44uHq+g3geyX/39VsnkhGBCA9dGlCPnrDDf4mL1dC9ZQoxFFDLy4MgP6c1vd AIScBoX09S5dLtndXG81/3H0ImR9g86ZlpR4jGqZZ7m2CY8rOS0oFTnbqrqGbprTKgUV YmhU6Ez4iniVYks7GidQM+p70N1SmhcYMvDyI1HxKWlPPVu0O4X+9yKx/Cr96iLsIVaI MwlHev8eb+G5hDxs2Vw1gkJu/dfGbmhINgG9LaOyLIewVKC+XzrUhlLoQCcgsHLX/qmK Mtk0x0AIdW0gIxM/NEQls/HWeO3ItiBdLHB9mGTN+bDegYcv1oCCfX6wz5WKQcabEbM9 Ah+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+dxqelAbvAgNzB6Yr+hihCSpE0opyXvrOZ0GbMhC7Fo=; b=Y17nAUw71RzWf7MCn0nFQ4Q+js97vOetRfi1Yv8izP790xuGuSWD8lkMFRfTS+8mV2 QAn6YWaiGSs/silHeoizN8PwgLwznl9Gzyi81rJa5tVbBBi3j8UmBKrP0FZNWCox9Gsv 1i1LC+bP8+Io891Uwja4CSLMdvOWlVv88jrRkbycCz9DaW2eq5OvWncaHPX+ICGS5Zww pLvtmL0SJcRDeFvFlr8lrxv3OAg+MP5lx5B9sjqOWz5snqTjUYwJ84Luk+sHEdgCJGhB npIIeoH1m/pjLM7W252JfA7hsaYoQFU1vXyEqLeGU61G/9gIau0u6lS9zuhjOtH1H0Bn U5Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IzXjk5b1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lv10si6812391ejb.316.2021.08.20.04.36.44; Fri, 20 Aug 2021 04:37:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IzXjk5b1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239876AbhHTLdG (ORCPT + 99 others); Fri, 20 Aug 2021 07:33:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239812AbhHTLdF (ORCPT ); Fri, 20 Aug 2021 07:33:05 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1BECC061575; Fri, 20 Aug 2021 04:32:27 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id b7so13584209edu.3; Fri, 20 Aug 2021 04:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+dxqelAbvAgNzB6Yr+hihCSpE0opyXvrOZ0GbMhC7Fo=; b=IzXjk5b14F2daFLa65zWeNOReFFiTePMbSrS3KBKO1lYrdhxSFmcN0hkmNj6A3N968 EtxIuUT+JPTRSHoNBQ/zejh6gt4Mai9VID/KWsprOSomppPZXas38GoZJJKx2rCBb/F7 3cD1Y02Xv7asguMQZ/4gQApF9l3nJxB4S9GvoGsUkEyRMbD8n+n0SvvvrBatmHVf8fHw vJSSq5Pcrh2CcJnHA4s27ItuIY6gAwPNNkoLu0v9eY6frzWYH+t9t0vqzOzSoDRO0Fg7 wYY52oeA29fRejQ/XB1TsAlSVY+dtzoFqfyiRZK0rH6QqdtB+i6rBqjkoABJkHIYtJpd 2QVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+dxqelAbvAgNzB6Yr+hihCSpE0opyXvrOZ0GbMhC7Fo=; b=f0/11XEKtNEwyaiy9s2VKS7JWobp4zHe328/FqZ88WYe1iRuKxCGFdvNlBWDcCy8Pm sriDttvVy821ZzDTLLK9rYDxJW56r4c6IkqBehOYsskZ+/bBSYgwf9H+7Sb7oQpiot1H OVl/NrW4zvZzBSpGW9N22y+Tg1h/vW+5M+DusYoVKLz/OUVakuyfDcbwBdFxF8IIQyuq lXFycNTKn9ddS9Sw5Yt7llCG1k70VHbTgKUGJyWFdtM/PBTzgaVfiZKvLZjzksplbSSe ehJ5kJ5nUbpRISEyABZE2V4L8FTHDMvHqZ8knwDq/i9GzWs50Oq0h1HmU+LVNQO6YxdT V3fQ== X-Gm-Message-State: AOAM532atuT/sFtNjm33q5ZPd/BGsRxkJPLhMlNwf2zZjZHHWEN2huqz CGd/93ZQKu3Iid+KyEg3scg= X-Received: by 2002:a05:6402:1206:: with SMTP id c6mr22181041edw.264.1629459146274; Fri, 20 Aug 2021 04:32:26 -0700 (PDT) Received: from honeypot.epfl.ch (mob-37-181-187-184.net.vodafone.it. [37.181.187.184]) by smtp.googlemail.com with ESMTPSA id x15sm2693333ejv.95.2021.08.20.04.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Aug 2021 04:32:25 -0700 (PDT) From: Riccardo Mancini To: Arnaldo Carvalho de Melo Cc: Ian Rogers , Namhyung Kim , Riccardo Mancini , Adrian Hunter , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] perf tests: dlfilter: free desc and long_desc in check_filter_desc Date: Fri, 20 Aug 2021 13:31:29 +0200 Message-Id: <20210820113132.724034-1-rickyman7@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In dlfilter-test, the function check_filter_desc calls get_filter_desc which allocates desc and long_desc. However, these variables are never deallocated. This patch adds the missing frees. Cc: Adrian Hunter Fixes: 9f9c9a8de2d5e96c ("perf tests: Add dlfilter test") Signed-off-by: Riccardo Mancini --- tools/perf/tests/dlfilter-test.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/dlfilter-test.c b/tools/perf/tests/dlfilter-test.c index 7eba7955d53154e1..bc03b5df6828d6fa 100644 --- a/tools/perf/tests/dlfilter-test.c +++ b/tools/perf/tests/dlfilter-test.c @@ -239,15 +239,20 @@ static int get_dlfilters_path(char *buf, size_t sz) static int check_filter_desc(struct test_data *td) { - char *long_desc; - char *desc; + char *long_desc = NULL; + char *desc = NULL; + int ret; if (get_filter_desc(td->dlfilters, "dlfilter-test-api-v0.so", &desc, &long_desc) && long_desc && !strcmp(long_desc, "Filter used by the 'dlfilter C API' perf test") && desc && !strcmp(desc, "dlfilter to test v0 C API")) - return 0; + ret = 0; + else + ret = -1; - return -1; + free(desc); + free(long_desc); + return ret; } static int get_ip_addr(struct test_data *td) -- 2.31.1