[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 05/09: Fix free of NULL pointer
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 05/09: Fix free of NULL pointer |
Date: |
Tue, 31 Jan 2017 05:09:13 +0100 |
This is an automated email from the git hooks/post-receive script.
bart-polot pushed a commit to branch master
in repository gnunet.
commit 7a469336dc169173558720df45c03a76bf50e140
Author: Bart Polot <address@hidden>
AuthorDate: Tue Jan 31 04:22:07 2017 +0100
Fix free of NULL pointer
---
src/cadet/cadet_api.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 3eaa78af8..e00203b25 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -1724,13 +1724,15 @@ GNUNET_CADET_close_port (struct GNUNET_CADET_Port *p)
{
struct GNUNET_CADET_PortMessage *msg;
struct GNUNET_MQ_Envelope *env;
+ struct GNUNET_HashCode *id;
env = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE);
- msg->port = *p->hash;
+ id = NULL != p->hash ? p->hash : &p->id;
+ msg->port = *id;
GNUNET_MQ_send (p->cadet->mq, env);
- GNUNET_CONTAINER_multihashmap_remove (p->cadet->ports, p->hash, p);
- GNUNET_free (p->hash);
+ GNUNET_CONTAINER_multihashmap_remove (p->cadet->ports, id, p);
+ GNUNET_free_non_null (p->hash);
GNUNET_free (p);
}
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] branch master updated (98fead2b7 -> 0e73a0143), gnunet, 2017/01/30
- [GNUnet-SVN] [gnunet] 01/09: CADET MQ API documentation improvements, gnunet, 2017/01/30
- [GNUnet-SVN] [gnunet] 05/09: Fix free of NULL pointer,
gnunet <=
- [GNUnet-SVN] [gnunet] 06/09: Implement channel cleanup in MQ API, simplify destroy channel, gnunet, 2017/01/30
- [GNUnet-SVN] [gnunet] 03/09: Add note for clarification, gnunet, 2017/01/30
- [GNUnet-SVN] [gnunet] 04/09: Implementation of port opening and handling in MQ, gnunet, 2017/01/30
- [GNUnet-SVN] [gnunet] 07/09: Refactor reconnect code, gnunet, 2017/01/30
- [GNUnet-SVN] [gnunet] 02/09: Implement the connect and create_channel call for mq api, gnunet, 2017/01/30
- [GNUnet-SVN] [gnunet] 09/09: Implement incoming traffic handling on MQ, gnunet, 2017/01/30
- [GNUnet-SVN] [gnunet] 08/09: Reconnect to service instead of aborting on a malformed data message, gnunet, 2017/01/30