Re: [AMBER-Developers] bug in ptraj.c (AmberTools 1.3)

From: Daniel Roe <>
Date: Tue, 23 Feb 2010 10:32:03 -0500

On Tue, Feb 23, 2010 at 4:20 AM, Hannes Loeffler <
> wrote:

> Shouldn't it be also idiomatic to set a pointer to NULL after free? I
> mention this because I see it in clearParm() but not in safe_free()
> (utility.c).

It won't work in safe_free because of the scope of the pointer. In the case
of clearParm() the function operates on the parm structure, which is more or
less global, so setting it to NULL from clearParm() will actually have an
affect on parm. However, in safe_free() the pointer is passed in, so setting
it to NULL inside the function has no affect on the pointer outside the

AMBER-Developers mailing list
Received on Tue Feb 23 2010 - 08:00:02 PST
Custom Search