Fix perf_crypto_rsa.c after various changes
[oweals/gnunet.git] / src / util / common_allocation.c
index 5280d73b256e382c56983bafc1eecd7dc441e5dd..95a19f00f227ecf503711c4712c4414bee439fa0 100644 (file)
@@ -1,6 +1,6 @@
 /*
      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
@@ -14,8 +14,8 @@
 
      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.
 */
 
 /**
@@ -24,7 +24,7 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_util_lib.h"
+#include "gnunet_crypto_lib.h"
 #if HAVE_MALLOC_H
 #include <malloc.h>
 #endif
@@ -224,8 +224,8 @@ GNUNET_xrealloc_ (void *ptr,
  * 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,
@@ -370,7 +370,8 @@ GNUNET_xgrow_ (void **old,
     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)