From 30361fe0e89a72e2dd248a93824b06d858e4e81a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 21 Apr 2020 00:54:49 +0200 Subject: make GNUNET_freez default, have GNUNET_free_nz for cases where that does not work --- src/include/gnunet_common.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/include') diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index 78aeb3de7..9e7c77786 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -1284,23 +1284,23 @@ GNUNET_is_zero_ (const void *a, * @ingroup memory * Wrapper around free. Frees the memory referred to by ptr. * Note that it is generally better to free memory that was - * allocated with #GNUNET_array_grow using #GNUNET_array_grow(mem, size, 0) instead of #GNUNET_free. + * allocated with #GNUNET_array_grow using #GNUNET_array_grow(mem, size, 0) instead of #GNUNET_free_nz. * * @param ptr location where to free the memory. ptr must have * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. */ -#define GNUNET_free(ptr) GNUNET_xfree_ (ptr, __FILE__, __LINE__) +#define GNUNET_free_nz(ptr) GNUNET_xfree_ (ptr, __FILE__, __LINE__) /** * @ingroup memory * Wrapper around free. Frees the memory referred to by ptr and sets ptr to NULL. * Note that it is generally better to free memory that was - * allocated with #GNUNET_array_grow using #GNUNET_array_grow(mem, size, 0) instead of #GNUNET_freez. + * allocated with #GNUNET_array_grow using #GNUNET_array_grow(mem, size, 0) instead of #GNUNET_free. * * @param ptr location where to free the memory. ptr must have * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. */ -#define GNUNET_freez(ptr) do { \ +#define GNUNET_free(ptr) do { \ GNUNET_xfree_ (ptr, __FILE__, __LINE__); \ ptr = NULL; \ } while (0) -- cgit v1.2.3