summaryrefslogtreecommitdiff
path: root/src/messenger/gnunet-messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/messenger/gnunet-messenger.c')
-rwxr-xr-x[-rw-r--r--]src/messenger/gnunet-messenger.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/messenger/gnunet-messenger.c b/src/messenger/gnunet-messenger.c
index 737bb83c8..094ae398d 100644..100755
--- a/src/messenger/gnunet-messenger.c
+++ b/src/messenger/gnunet-messenger.c
@@ -229,18 +229,12 @@ on_identity (void *cls, struct GNUNET_MESSENGER_Handle *handle)
if (room_key)
GNUNET_CRYPTO_hash (room_key, strlen (room_key), &key);
+ struct GNUNET_PeerIdentity door_peer;
struct GNUNET_PeerIdentity *door = NULL;
- if (door_id)
- {
- door = GNUNET_new(struct GNUNET_PeerIdentity);
-
- if (GNUNET_OK != GNUNET_CRYPTO_eddsa_public_key_from_string (door_id, strlen (door_id), &(door->public_key)))
- {
- GNUNET_free(door);
- door = NULL;
- }
- }
+ if ((door_id) &&
+ (GNUNET_OK == GNUNET_CRYPTO_eddsa_public_key_from_string (door_id, strlen (door_id), &(door_peer.public_key))))
+ door = &door_peer;
const char *name = GNUNET_MESSENGER_get_name (handle);