]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Set talloc type of slab elements
authorNick Porter <nick@portercomputing.co.uk>
Mon, 30 Jan 2023 13:31:58 +0000 (13:31 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 9 Feb 2023 12:13:16 +0000 (12:13 +0000)
So that doing talloc_get_type_abort() on the entries returned by the
reserve function will work.

src/lib/util/slab.h

index e5aa5c71de15c84303d3a3b11e6741943236896c..c2cb61efdfde1b86a76a5bdcd6a68053d438548e 100644 (file)
@@ -245,6 +245,7 @@ extern "C" {
                                } else { \
                                        MEM(new_element = talloc_zero(slab, fr_ ## _name ## _slab_element_t)); \
                                } \
+                               talloc_set_type(new_element, _type); \
                                talloc_set_destructor(new_element, _ ## _type ## _element_free); \
                                fr_ ## _name ## _slab_element_insert_tail(&slab->avail, new_element); \
                                new_element->slab = slab; \