gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 03/06: reclaim(cli): fix memory leak


From: gnunet
Subject: [gnunet] 03/06: reclaim(cli): fix memory leak
Date: Sun, 29 Sep 2024 16:32:39 +0200

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

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

commit 10f50572e35feb108376c93bc98ae1c33dad4d3f
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Sun Sep 29 16:25:20 2024 +0200

    reclaim(cli): fix memory leak
---
 src/cli/reclaim/gnunet-did.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/cli/reclaim/gnunet-did.c b/src/cli/reclaim/gnunet-did.c
index d0b6c8f26..d68b40b78 100644
--- a/src/cli/reclaim/gnunet-did.c
+++ b/src/cli/reclaim/gnunet-did.c
@@ -380,7 +380,7 @@ create_did_ego_lockup_cb (void *cls, struct 
GNUNET_IDENTITY_Ego *ego)
   else
   {
     char *did_tmp = DID_identity_to_did (ego);
-    void *cls_tmp = malloc (strlen (did_tmp) + 1);
+    void *cls_tmp = GNUNET_malloc (strlen (did_tmp) + 1);
     struct GNUNET_TIME_Relative expire_relative;
 
     if (expire == NULL)
@@ -395,6 +395,7 @@ create_did_ego_lockup_cb (void *cls, struct 
GNUNET_IDENTITY_Ego *ego)
       printf ("Failed to read given expiration time\n");
       GNUNET_SCHEDULER_add_now (cleanup, NULL);
       ret = 1;
+      GNUNET_free (cls_tmp);
       return;
     }
 
@@ -410,8 +411,10 @@ create_did_ego_lockup_cb (void *cls, struct 
GNUNET_IDENTITY_Ego *ego)
       printf ("An error occurred while creating the DID.\n");
       ret = 1;
       GNUNET_SCHEDULER_add_now (&cleanup, NULL);
+      GNUNET_free (cls_tmp);
       return;
     }
+    GNUNET_free (cls_tmp);
   }
 }
 

-- 
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]