Fix perf_crypto_rsa.c after various changes
[oweals/gnunet.git] / src / util / common_allocation.c
index e398e19ae33e4d53756e6b958896a05fba3b6f23..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
@@ -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)