gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 144/164: Fixed mem leak


From: gnunet
Subject: [gnunet] 144/164: Fixed mem leak
Date: Fri, 30 Jul 2021 15:33:30 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit 774ff46b839b96a4004062447ae0fc8148312f8e
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Thu Jun 10 00:45:35 2021 +0200

    Fixed mem leak
---
 src/setu/gnunet-service-setu.c | 39 +++++++++++++++------------------------
 1 file changed, 15 insertions(+), 24 deletions(-)

diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index fa717f2c4..711b642a5 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -1245,31 +1245,22 @@ is_message_in_message_control_flow (struct
   enum MESSAGE_CONTROL_FLOW_STATE *mcfs;
 
   cfe = GNUNET_CONTAINER_multihashmap_get (hash_map, hash_code);
-  if (NULL == cfe)
-  {
-    cfe = (struct messageControlFlowElement*) GNUNET_malloc (sizeof(struct
-                                                                       
messageControlFlowElement));
-  }
 
-  if (OFFER_MESSAGE == mt)
-  {
-    mcfs = &cfe->offer;
-  }
-  else if (DEMAND_MESSAGE == mt)
-  {
-    mcfs = &cfe->demand;
-  }
-  else if (ELEMENT_MESSAGE == mt)
-  {
-    mcfs = &cfe->element;
-  }
-  else
-  {
-    return GNUNET_SYSERR;
-  }
-  if (*mcfs != MESSAGE_EMPTY)
-  {
-    return GNUNET_NO;
+  if(cfe != NULL) {
+      if (OFFER_MESSAGE == mt)
+      {
+          mcfs = &cfe->offer;
+      }
+      else if (DEMAND_MESSAGE == mt) {
+          mcfs = &cfe->demand;
+      } else if (ELEMENT_MESSAGE == mt) {
+          mcfs = &cfe->element;
+      } else {
+          return GNUNET_SYSERR;
+      }
+      if (*mcfs != MESSAGE_EMPTY) {
+          return GNUNET_NO;
+      }
   }
   return GNUNET_YES;
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]