From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v2 3/7] libxl: make some _dipose functions idempotent and tolerate NULL Date: Mon, 2 Mar 2015 17:07:10 +0000 Message-ID: <1425316030.24959.22.camel@citrix.com> References: <1424876166-9618-1-git-send-email-wei.liu2@citrix.com> <1424876166-9618-4-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1424876166-9618-4-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2015-02-25 at 14:56 +0000, Wei Liu wrote: > free(sl[i]); > + sl[i] = NULL; I wonder if a helper which takes a void**p and does "free(*p); *p = NULL" would be at all useful? (NB, I intend to apply this patch regardless and am in the process of doing so)