aboutsummaryrefslogtreecommitdiff
path: root/src/peerstore
diff options
context:
space:
mode:
authorDavid Barksdale <amatus.amongus@gmail.com>2014-12-20 17:02:44 +0000
committerDavid Barksdale <amatus.amongus@gmail.com>2014-12-20 17:02:44 +0000
commit806b3103565a80b2080efee722f702d7870ad5c7 (patch)
tree9aeb3a7548917a86c084a988dfb055ca2612f394 /src/peerstore
parent7f57da285eb93330722ec6b6176c9187d355d03f (diff)
Remove superflous heap allocation
Diffstat (limited to 'src/peerstore')
-rw-r--r--src/peerstore/gnunet-service-peerstore.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/peerstore/gnunet-service-peerstore.c b/src/peerstore/gnunet-service-peerstore.c
index 3f54eed85a..8af1514000 100644
--- a/src/peerstore/gnunet-service-peerstore.c
+++ b/src/peerstore/gnunet-service-peerstore.c
@@ -250,15 +250,12 @@ record_iterator (void *cls, const struct GNUNET_PEERSTORE_Record *record,
if (NULL == record)
{
/* No more records */
- struct GNUNET_MessageHeader *endmsg;
+ struct GNUNET_MessageHeader endmsg;
- endmsg = GNUNET_new (struct GNUNET_MessageHeader);
-
- endmsg->size = htons (sizeof (struct GNUNET_MessageHeader));
- endmsg->type = htons (GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_END);
- GNUNET_SERVER_notification_context_unicast (nc, cls_record->client, endmsg,
+ endmsg.size = htons (sizeof (struct GNUNET_MessageHeader));
+ endmsg.type = htons (GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_END);
+ GNUNET_SERVER_notification_context_unicast (nc, cls_record->client, &endmsg,
GNUNET_NO);
- GNUNET_free (endmsg);
GNUNET_SERVER_receive_done (cls_record->client,
NULL == emsg ? GNUNET_OK : GNUNET_SYSERR);
PEERSTORE_destroy_record (cls_record);