aboutsummaryrefslogtreecommitdiff
path: root/src/identity-provider
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-08-26 12:54:26 +0000
committerChristian Grothoff <christian@grothoff.org>2016-08-26 12:54:26 +0000
commit140c058ad6dc7a96783b701928b71afd0374ff71 (patch)
treec85a7540a4e936150325a7660b3680f23b8a0c7b /src/identity-provider
parent9e9c2fdf87ff362cee3851a0a3e584a0c5696df3 (diff)
downloadgnunet-140c058ad6dc7a96783b701928b71afd0374ff71.tar.gz
gnunet-140c058ad6dc7a96783b701928b71afd0374ff71.zip
-fix memory leak
Diffstat (limited to 'src/identity-provider')
-rw-r--r--src/identity-provider/gnunet-service-identity-provider.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/identity-provider/gnunet-service-identity-provider.c b/src/identity-provider/gnunet-service-identity-provider.c
index 8ed976826..2c400dc9c 100644
--- a/src/identity-provider/gnunet-service-identity-provider.c
+++ b/src/identity-provider/gnunet-service-identity-provider.c
@@ -1316,7 +1316,8 @@ handle_exchange_message (void *cls,
1316 &xchange_handle->ticket)) 1316 &xchange_handle->ticket))
1317 { 1317 {
1318 GNUNET_free (xchange_handle); 1318 GNUNET_free (xchange_handle);
1319 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 1319 GNUNET_SERVER_receive_done (client,
1320 GNUNET_SYSERR);
1320 return; 1321 return;
1321 } 1322 }
1322 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Looking for token under %s\n", 1323 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Looking for token under %s\n",
@@ -1326,16 +1327,18 @@ handle_exchange_message (void *cls,
1326 xchange_handle->ticket->payload->label); 1327 xchange_handle->ticket->payload->label);
1327 GNUNET_SERVER_receive_done (client, GNUNET_OK); 1328 GNUNET_SERVER_receive_done (client, GNUNET_OK);
1328 GNUNET_SERVER_notification_context_add (nc, client); 1329 GNUNET_SERVER_notification_context_add (nc, client);
1329 GNUNET_SERVER_client_set_user_context (client, xchange_handle); 1330 GNUNET_SERVER_client_set_user_context (client,
1331 xchange_handle);
1330 xchange_handle->client = client; 1332 xchange_handle->client = client;
1331 xchange_handle->lookup_request = GNUNET_GNS_lookup (gns_handle, 1333 xchange_handle->lookup_request
1332 lookup_query, 1334 = GNUNET_GNS_lookup (gns_handle,
1333 &xchange_handle->ticket->payload->identity_key, 1335 lookup_query,
1334 GNUNET_GNSRECORD_TYPE_ID_TOKEN, 1336 &xchange_handle->ticket->payload->identity_key,
1335 GNUNET_GNS_LO_LOCAL_MASTER, 1337 GNUNET_GNSRECORD_TYPE_ID_TOKEN,
1336 NULL, 1338 GNUNET_GNS_LO_LOCAL_MASTER,
1337 &process_lookup_result, 1339 NULL,
1338 xchange_handle); 1340 &process_lookup_result,
1341 xchange_handle);
1339 GNUNET_free (lookup_query); 1342 GNUNET_free (lookup_query);
1340 1343
1341} 1344}
@@ -1526,19 +1529,21 @@ handle_issue_message (void *cls,
1526 } 1529 }
1527 im = (const struct GNUNET_IDENTITY_PROVIDER_IssueMessage *) message; 1530 im = (const struct GNUNET_IDENTITY_PROVIDER_IssueMessage *) message;
1528 scopes = (const char *) &im[1]; 1531 scopes = (const char *) &im[1];
1529 issue_handle = GNUNET_malloc (sizeof (struct IssueHandle));
1530 issue_handle->attr_map = GNUNET_CONTAINER_multihashmap_create (5,
1531 GNUNET_NO);
1532 if ('\0' != scopes[size - sizeof (struct GNUNET_IDENTITY_PROVIDER_IssueMessage) - 1]) 1532 if ('\0' != scopes[size - sizeof (struct GNUNET_IDENTITY_PROVIDER_IssueMessage) - 1])
1533 { 1533 {
1534 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Malformed scopes received!\n"); 1534 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1535 "Malformed scopes received!\n");
1535 GNUNET_break (0); 1536 GNUNET_break (0);
1536 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 1537 GNUNET_SERVER_receive_done (client,
1538 GNUNET_SYSERR);
1537 return; 1539 return;
1538 } 1540 }
1541 issue_handle = GNUNET_malloc (sizeof (struct IssueHandle));
1542 issue_handle->attr_map = GNUNET_CONTAINER_multihashmap_create (5,
1543 GNUNET_NO);
1539 scopes_tmp = GNUNET_strdup (scopes); 1544 scopes_tmp = GNUNET_strdup (scopes);
1540 scope = strtok(scopes_tmp, ","); 1545
1541 for (; NULL != scope; scope = strtok (NULL, ",")) 1546 for (scope = strtok (scopes_tmp, ","); NULL != scope; scope = strtok (NULL, ","))
1542 { 1547 {
1543 GNUNET_CRYPTO_hash (scope, 1548 GNUNET_CRYPTO_hash (scope,
1544 strlen (scope), 1549 strlen (scope),