]> git.ozlabs.org Git - ccan/blobdiff - ccan/tal/tal.h
tal: make tal_free() return NULL
[ccan] / ccan / tal / tal.h
index 1ed15c75f46fd664b6f57b10c65bcd8eb9790406..42245f68660277c990561502f50b00f94297bcb5 100644 (file)
@@ -53,14 +53,15 @@ typedef void tal_t;
  * @p: NULL, or tal allocated object to free.
  *
  * This calls the destructors for p (if any), then does the same for all its
- * children (recursively) before finally freeing the memory.
+ * children (recursively) before finally freeing the memory.  It returns
+ * NULL, for convenience.
  *
  * Note: errno is preserved by this call.
  *
  * Example:
- *     tal_free(p);
+ *     p = tal_free(p);
  */
-void tal_free(const tal_t *p);
+void *tal_free(const tal_t *p);
 
 /**
  * tal_arr - allocate an array of objects.