bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch


From: Bruno Haible
Subject: Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch
Date: Wed, 10 Sep 2003 21:29:33 +0200
User-agent: KMail/1.5

Gary V. Vaughan wrote:
+/* Only free P if non-NULL.  */
+
+void *
+xfree (void *p)
+{
+  if (p)
+    free (p);
+  return 0;
+}

The benefit of this function over free() itself is so small... Is it really
useful to put this function into nearly every GNU executable?

I'd have less objections if you would declare the function inline in the
header file, or drop the function and instead write
  #define XFREE(Var) ((Var) ? (free (Var), NULL) : NULL)

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]