/*
This file is part of GNUnet.
- Copyright (C) 2001, 2002, 2003, 2005, 2006 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2001, 2002, 2003, 2005, 2006 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
* @author Christian Grothoff
*/
#include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
#if HAVE_MALLOC_H
#include <malloc.h>
#endif
* want to keep track of allocations.
*
* @param ptr the pointer to free
- * @param filename where in the code was the call to GNUNET_array_grow
- * @param linenumber where in the code was the call to GNUNET_array_grow
+ * @param filename where in the code was the call to GNUNET_free
+ * @param linenumber where in the code was the call to GNUNET_free
*/
void
GNUNET_xfree_ (void *ptr,
memset (tmp, 0, size); /* client code should not rely on this, though... */
if (*oldCount > newCount)
*oldCount = newCount; /* shrink is also allowed! */
- memcpy (tmp, *old, elementSize * (*oldCount));
+ if (NULL != *old)
+ memcpy (tmp, *old, elementSize * (*oldCount));
}
if (*old != NULL)