gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-twister] 21/34: dup'ing path string.


From: gnunet
Subject: [GNUnet-SVN] [taler-twister] 21/34: dup'ing path string.
Date: Sat, 17 Mar 2018 01:58:12 +0100

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

marcello pushed a commit to branch master
in repository twister.

commit ef7127b4b5362e0f458edad2986f4bdac7c100a6
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Mar 8 18:19:38 2018 +0100

    dup'ing path string.
---
 src/twister/taler-twister-service.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/twister/taler-twister-service.c 
b/src/twister/taler-twister-service.c
index ae3d3d0..786768d 100644
--- a/src/twister/taler-twister-service.c
+++ b/src/twister/taler-twister-service.c
@@ -829,6 +829,7 @@ delete_object (struct MHD_Connection *con,
   char *token;
   char *last_token;
   char *mod_body;
+  char *path_dup;
   unsigned int index;
 
   if (NULL == (parsed_response = json_loadb
@@ -840,9 +841,10 @@ delete_object (struct MHD_Connection *con,
                                hr->response);
   }
 
-  last_token = strrchr (delete_path, '.') + 1;
+  path_dup = GNUNET_strdup (delete_path);
+  last_token = strrchr (path_dup, '.') + 1;
   /* Give first nondelim char. */
-  token = strtok (delete_path, ".");
+  token = strtok (path_dup, ".");
   element = parsed_response;
   do
   {
@@ -850,8 +852,13 @@ delete_object (struct MHD_Connection *con,
      * another option is to return an empty body. */
     if (NULL == token)
     {
-      TALER_LOG_WARNING ("Whole body won't be deleted\n");
+      TALER_LOG_WARNING ("Whole body won't be deleted"
+                         ", token: %s/%p, last_token: %s/%p\n",
+                         token, token,
+                         last_token, last_token);
+
       json_decref (parsed_response); 
+      GNUNET_free (path_dup);
       return MHD_queue_response (con,
                                  hr->response_code,
                                  hr->response);
@@ -873,6 +880,7 @@ delete_object (struct MHD_Connection *con,
     }
     TALER_LOG_WARNING ("Path token '%s' not found\n",
                        token);
+    GNUNET_free (path_dup);
     return MHD_queue_response (con,
                                hr->response_code,
                                hr->response);
@@ -895,6 +903,7 @@ delete_object (struct MHD_Connection *con,
   {
     TALER_LOG_WARNING ("Could not delete '%s'\n", last_token);
     json_decref (parsed_response); 
+    GNUNET_free (path_dup);
     return MHD_queue_response (con,
                                hr->response_code,
                                hr->response);
@@ -906,7 +915,6 @@ delete_object (struct MHD_Connection *con,
      MHD_RESPMEM_MUST_COPY);
   json_decref (parsed_response); 
   delete_path[0] = '\0';
- 
   struct HttpResponseHeader *header;
   for (header = hr->header_head;
        NULL != header;
@@ -915,6 +923,7 @@ delete_object (struct MHD_Connection *con,
       (MHD_YES == MHD_add_response_header (hr->mod_response,
                                            header->type,
                                            header->value));
+  GNUNET_free (path_dup);
   return MHD_queue_response (con,
                              hr->response_code,
                              hr->mod_response);
@@ -1191,7 +1200,12 @@ create_response (void *cls,
   }
 
   if ('\0' != delete_path[0])
+  {
+    TALER_LOG_DEBUG ("Will delete path: %s\n",
+                     delete_path);
     return delete_object (con, hr);
+  }
+
 
   /* response might have been modified. */
   return MHD_queue_response (con,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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