+/**
+ * talloc_set - allocate dynamic memory for a type, into a pointer
+ * @ptr: pointer to the pointer to assign.
+ * @ctx: context to be parent of this allocation, or NULL.
+ *
+ * talloc_set() does a talloc, but also adds a destructor which will make the
+ * pointer invalid when it is freed. This can find many use-after-free bugs.
+ *
+ * Note that the destructor is chained off a zero-length allocation, and so
+ * is not affected by talloc_set_destructor().
+ *
+ * Example:
+ * unsigned int *a;
+ * a = talloc(NULL, unsigned int);
+ * talloc_set(&b, a, unsigned int);
+ * talloc_free(a);
+ * *b = 1; // This will crash!
+ *
+ * See Also:
+ * talloc.
+ */
+#define talloc_set(pptr, ctx) \
+ _talloc_set((pptr), (ctx), sizeof(&**(pptr)), __location__)
+