From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752671AbdA3Kr2 (ORCPT ); Mon, 30 Jan 2017 05:47:28 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34539 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141AbdA3KrI (ORCPT ); Mon, 30 Jan 2017 05:47:08 -0500 Subject: Re: [PATCH 1/2] perf tools: Use zfree() instead of free() in parse-events.c To: Jiri Olsa References: <1485753819-12857-1-git-send-email-treeze.taeung@gmail.com> <20170130090159.GC22029@krava> Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Jiri Olsa , Namhyung Kim , Ingo Molnar , Peter Zijlstra , Wang Nan From: Taeung Song Message-ID: Date: Mon, 30 Jan 2017 19:37:58 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20170130090159.GC22029@krava> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/30/2017 06:01 PM, Jiri Olsa wrote: > On Mon, Jan 30, 2017 at 02:23:38PM +0900, Taeung Song wrote: >> Currently there are several parts not checking NULL >> after allocating with zalloc() or asigning NULL value >> to a pointer variable after doing free(). >> >> So I fill in code checking NULL and >> use zfree() instead of free(). > > can't see directly reasons for zfree usage, > but it looks reasonable.. do you have any > crash reports due to missing zfree? No, Just I read source code util/parse-events.c And I found several insufficiency, shortcoming not checking NULL or assigning NULL value to a pointer variable after free(). So, I think we can use zfree() insteadof free()+assigning NULL. Change commit message to be more appropriate ? Thanks, Taeung