summaryrefslogtreecommitdiff
path: root/src/statistics/statistics_api.c
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-12-19 06:00:23 +0000
committerLRN <lrn1986@gmail.com>2013-12-19 06:00:23 +0000
commite0ca7357cd0bfedc5c29cb731b56279fef8da059 (patch)
treeecfd47cf59bc00e656b53fd59c58f5038e342d65 /src/statistics/statistics_api.c
parent92fd84dc7ef98452f848a62677c61a2b80b5835e (diff)
malloc -> new
Diffstat (limited to 'src/statistics/statistics_api.c')
-rw-r--r--src/statistics/statistics_api.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c
index d99ad8aec..04e85a07e 100644
--- a/src/statistics/statistics_api.c
+++ b/src/statistics/statistics_api.c
@@ -343,7 +343,7 @@ schedule_watch_request (struct GNUNET_STATISTICS_Handle *h,
GNUNET_break (0);
return;
}
- ai = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_GetHandle));
+ ai = GNUNET_new (struct GNUNET_STATISTICS_GetHandle);
ai->sh = h;
ai->subsystem = GNUNET_strdup (watch->subsystem);
ai->name = GNUNET_strdup (watch->name);
@@ -932,7 +932,7 @@ GNUNET_STATISTICS_create (const char *subsystem,
return NULL;
GNUNET_assert (NULL != subsystem);
GNUNET_assert (NULL != cfg);
- ret = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_Handle));
+ ret = GNUNET_new (struct GNUNET_STATISTICS_Handle);
ret->cfg = cfg;
ret->subsystem = GNUNET_strdup (subsystem);
ret->backoff = GNUNET_TIME_UNIT_MILLISECONDS;
@@ -1158,7 +1158,7 @@ GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle,
slen2 = strlen (name) + 1;
GNUNET_assert (slen1 + slen2 + sizeof (struct GNUNET_MessageHeader) <
GNUNET_SERVER_MAX_MESSAGE_SIZE);
- ai = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_GetHandle));
+ ai = GNUNET_new (struct GNUNET_STATISTICS_GetHandle);
ai->sh = handle;
ai->subsystem = GNUNET_strdup (subsystem);
ai->name = GNUNET_strdup (name);
@@ -1220,7 +1220,7 @@ GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle,
if (NULL == handle)
return GNUNET_SYSERR;
- w = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_WatchEntry));
+ w = GNUNET_new (struct GNUNET_STATISTICS_WatchEntry);
w->subsystem = GNUNET_strdup (subsystem);
w->name = GNUNET_strdup (name);
w->proc = proc;
@@ -1354,7 +1354,7 @@ add_setter_action (struct GNUNET_STATISTICS_Handle *h, const char *name,
return;
}
/* no existing entry matches, create a fresh one */
- ai = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_GetHandle));
+ ai = GNUNET_new (struct GNUNET_STATISTICS_GetHandle);
ai->sh = h;
ai->subsystem = GNUNET_strdup (h->subsystem);
ai->name = GNUNET_strdup (name);