]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
More checks for talloc_pooled_object
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 24 Nov 2019 05:06:28 +0000 (00:06 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 24 Nov 2019 05:07:22 +0000 (00:07 -0500)
src/lib/util/talloc.h

index c319e7fe961652b1cca7594da6cc0e3b328094b5..7f4b61017d3f26095181da2fda8f46bc5824cc08 100644 (file)
@@ -45,7 +45,7 @@ TALLOC_CTX    *talloc_page_aligned_pool(TALLOC_CTX *ctx, void **start, void **end,
 /*
  *     Add variant that zeroes out newly allocated memory
  */
-#ifdef HAVE__TALLOC_POOLED_OBJECT
+#if defined(HAVE__TALLOC_POOLED_OBJECT) && defined(talloc_pooled_object)
 #  define HAVE_TALLOC_ZERO_POOLED_OBJECT       1
 #  define HAVE_TALLOC_POOLED_OBJECT            1
 
@@ -71,6 +71,7 @@ static inline TALLOC_CTX *_talloc_zero_pooled_object(const void *ctx,
 #else
 #  define      talloc_zero_pooled_object(_ctx, _type, _num_subobjects, _total_subobjects_size) \
                talloc_zero(_ctx, _type)
+#undef talloc_pooled_object
 #  define      talloc_pooled_object(_ctx, _type, _num_subobjects, _total_subobjects_size) \
                talloc(_ctx, _type)
 #endif