From 806b3103565a80b2080efee722f702d7870ad5c7 Mon Sep 17 00:00:00 2001 From: David Barksdale Date: Sat, 20 Dec 2014 17:02:44 +0000 Subject: [PATCH] Remove superflous heap allocation --- src/peerstore/gnunet-service-peerstore.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/peerstore/gnunet-service-peerstore.c b/src/peerstore/gnunet-service-peerstore.c index 3f54eed85..8af151400 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); -- 2.25.1