GNUNET_break_op (0);
return NULL;
}
- ret = GNUNET_malloc (sizeof (struct GSC_TypeMap));
+ ret = GNUNET_new (struct GSC_TypeMap);
memcpy (ret, &msg[1], sizeof (struct GSC_TypeMap));
return ret;
case GNUNET_MESSAGE_TYPE_CORE_COMPRESSED_TYPE_MAP:
GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# type maps received"),
1, GNUNET_NO);
- ret = GNUNET_malloc (sizeof (struct GSC_TypeMap));
+ ret = GNUNET_new (struct GSC_TypeMap);
dlen = sizeof (struct GSC_TypeMap);
if ((Z_OK !=
uncompress ((Bytef *) ret, &dlen, (const Bytef *) &msg[1],
* Test if any of the types from the types array is in the
* given type map.
*
- * @param map map to test
+ * @param tmap map to test
* @param types array of types
* @param tcnt number of entries in types
* @return GNUNET_YES if a type is in the map, GNUNET_NO if not
/**
* Add additional types to a given typemap.
*
- * @param map map to extend (not changed)
+ * @param tmap map to extend (not changed)
* @param types array of types to add
* @param tcnt number of entries in types
* @return updated type map (fresh copy)
struct GSC_TypeMap *ret;
unsigned int i;
- ret = GNUNET_malloc (sizeof (struct GSC_TypeMap));
+ ret = GNUNET_new (struct GSC_TypeMap);
if (NULL != tmap)
memcpy (ret, tmap, sizeof (struct GSC_TypeMap));
for (i = 0; i < tcnt; i++)
/**
* Create an empty type map.
*
- * @param map a type map
+ * @return an empty type map
*/
struct GSC_TypeMap *
GSC_TYPEMAP_create ()
{
- return GNUNET_malloc (sizeof (struct GSC_TypeMap));
+ return GNUNET_new (struct GSC_TypeMap);
}
/**
* Free the given type map.
*
- * @param map a type map
+ * @param tmap a type map
*/
void
GSC_TYPEMAP_destroy (struct GSC_TypeMap *tmap)