[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: fix memory leak
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: fix memory leak |
Date: |
Thu, 26 Sep 2019 13:57:33 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new 9f6bf3e fix memory leak
9f6bf3e is described below
commit 9f6bf3e0cfbd9cf974f614dac58218c10d33c9c2
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Sep 26 13:57:31 2019 +0200
fix memory leak
---
src/backend/taler-merchant-httpd.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/src/backend/taler-merchant-httpd.c
b/src/backend/taler-merchant-httpd.c
index 0accbb8..8e4db76 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -298,16 +298,13 @@ url_handler (void *cls,
&TMH_MHD_handler_static_response, MHD_HTTP_NOT_FOUND
};
- struct TM_HandlerContext *hc;
+ struct TM_HandlerContext *hc = *con_cls;
struct GNUNET_AsyncScopeId aid;
const char *correlation_id = NULL;
char *instance_id;
- char *effective_url;
+ const char *effective_url;
int ret;
-
- hc = *con_cls;
-
if (NULL == hc)
{
GNUNET_async_scope_fresh (&aid);
@@ -347,14 +344,17 @@ url_handler (void *cls,
* from the beginning of the request URL. */
{
const char *instance_prefix = "/instances/";
- if (0 == strncmp (url, instance_prefix, strlen (instance_prefix)))
+
+ if (0 == strncmp (url,
+ instance_prefix,
+ strlen (instance_prefix)))
{
- // url starts with "/instance/"
- instance_id = GNUNET_strdup (url + strlen (instance_prefix));
- char *slash = strchr (instance_id, '/');
+ /* url starts with "/instances/" */
+ const char *istart = url + strlen (instance_prefix);
+ const char *slash = strchr (istart, '/');
+
if (NULL == slash)
{
- GNUNET_free (instance_id);
return TMH_MHD_handler_static_response (&h404,
connection,
con_cls,
@@ -362,18 +362,18 @@ url_handler (void *cls,
upload_data_size,
NULL);
}
- effective_url = GNUNET_strdup (slash);
- *slash = '\0';
+ instance_id = GNUNET_strndup (istart,
+ slash - istart);
+ effective_url = slash;
}
else
{
- effective_url = GNUNET_strdup (url);
+ effective_url = url;
instance_id = NULL;
}
}
-
- for (unsigned int i=0;NULL != handlers[i].url;i++)
+ for (unsigned int i = 0; NULL != handlers[i].url; i++)
{
struct TMH_RequestHandler *rh = &handlers[i];
@@ -384,10 +384,10 @@ url_handler (void *cls,
rh->method)) ) )
{
ret = rh->handler (rh,
- connection,
- con_cls,
- upload_data,
- upload_data_size,
+ connection,
+ con_cls,
+ upload_data,
+ upload_data_size,
instance_id);
hc = *con_cls;
if (NULL != hc)
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: fix memory leak,
gnunet <=