diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-12-13 21:09:11 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-12-13 21:09:11 +0100 |
commit | 12a3d957faa3932db31ffea0497dd083fd381b86 (patch) | |
tree | 405a2670534e25748b9132c0605e6cad4796387b | |
parent | 490a5b6451470aef6a5a963e4ccef3b2ca5cd326 (diff) | |
download | gnunet-12a3d957faa3932db31ffea0497dd083fd381b86.tar.gz gnunet-12a3d957faa3932db31ffea0497dd083fd381b86.zip |
-fix memleaks
-rw-r--r-- | src/credential/gnunet-service-credential.c | 29 | ||||
-rw-r--r-- | src/gns/gns_api.c | 1 |
2 files changed, 29 insertions, 1 deletions
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c index ea74bd7d2..38d74e2ab 100644 --- a/src/credential/gnunet-service-credential.c +++ b/src/credential/gnunet-service-credential.c | |||
@@ -298,6 +298,16 @@ cleanup_delegation_queue (struct DelegationQueueEntry *dq_entry) | |||
298 | child); | 298 | child); |
299 | cleanup_delegation_queue (child); | 299 | cleanup_delegation_queue (child); |
300 | } | 300 | } |
301 | if (NULL != dq_entry->issuer_key) | ||
302 | GNUNET_free (dq_entry->issuer_key); | ||
303 | if (NULL != dq_entry->lookup_attribute) | ||
304 | GNUNET_free (dq_entry->lookup_attribute); | ||
305 | if (NULL != dq_entry->issuer_attribute) | ||
306 | GNUNET_free (dq_entry->issuer_attribute); | ||
307 | if (NULL != dq_entry->unresolved_attribute_delegation) | ||
308 | GNUNET_free (dq_entry->unresolved_attribute_delegation); | ||
309 | if (NULL != dq_entry->attr_trailer) | ||
310 | GNUNET_free (dq_entry->attr_trailer); | ||
301 | if (NULL != dq_entry->lookup_request) | 311 | if (NULL != dq_entry->lookup_request) |
302 | { | 312 | { |
303 | GNUNET_GNS_lookup_cancel (dq_entry->lookup_request); | 313 | GNUNET_GNS_lookup_cancel (dq_entry->lookup_request); |
@@ -317,6 +327,7 @@ cleanup_delegation_queue (struct DelegationQueueEntry *dq_entry) | |||
317 | static void | 327 | static void |
318 | cleanup_handle (struct VerifyRequestHandle *vrh) | 328 | cleanup_handle (struct VerifyRequestHandle *vrh) |
319 | { | 329 | { |
330 | struct CredentialRecordEntry *cr_entry; | ||
320 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 331 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
321 | "Cleaning up...\n"); | 332 | "Cleaning up...\n"); |
322 | if (NULL != vrh->lookup_request) | 333 | if (NULL != vrh->lookup_request) |
@@ -324,9 +335,22 @@ cleanup_handle (struct VerifyRequestHandle *vrh) | |||
324 | GNUNET_GNS_lookup_cancel (vrh->lookup_request); | 335 | GNUNET_GNS_lookup_cancel (vrh->lookup_request); |
325 | vrh->lookup_request = NULL; | 336 | vrh->lookup_request = NULL; |
326 | } | 337 | } |
338 | if (NULL != vrh->credential) | ||
339 | GNUNET_free (vrh->credential); | ||
327 | cleanup_delegation_queue (vrh->chain_start); | 340 | cleanup_delegation_queue (vrh->chain_start); |
328 | if (NULL != vrh->issuer_attribute) | 341 | if (NULL != vrh->issuer_attribute) |
329 | GNUNET_free (vrh->issuer_attribute); | 342 | GNUNET_free (vrh->issuer_attribute); |
343 | for (cr_entry = vrh->cred_chain_head; | ||
344 | NULL != vrh->cred_chain_head; | ||
345 | cr_entry = vrh->cred_chain_head) | ||
346 | { | ||
347 | GNUNET_CONTAINER_DLL_remove (vrh->cred_chain_head, | ||
348 | vrh->cred_chain_tail, | ||
349 | cr_entry); | ||
350 | if (NULL != cr_entry->data) | ||
351 | GNUNET_free (cr_entry->data); | ||
352 | GNUNET_free (cr_entry); | ||
353 | } | ||
330 | GNUNET_free (vrh); | 354 | GNUNET_free (vrh); |
331 | } | 355 | } |
332 | 356 | ||
@@ -712,7 +736,10 @@ handle_credential_query (void* cls, | |||
712 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 736 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
713 | "Looking up %s\n", issuer_attribute_name); | 737 | "Looking up %s\n", issuer_attribute_name); |
714 | dq_entry = GNUNET_new (struct DelegationQueueEntry); | 738 | dq_entry = GNUNET_new (struct DelegationQueueEntry); |
715 | dq_entry->issuer_key = &vrh->issuer_key; | 739 | dq_entry->issuer_key = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPublicKey); |
740 | memcpy (dq_entry->issuer_key, | ||
741 | &vrh->issuer_key, | ||
742 | sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)); | ||
716 | dq_entry->issuer_attribute = GNUNET_strdup (vrh->issuer_attribute); | 743 | dq_entry->issuer_attribute = GNUNET_strdup (vrh->issuer_attribute); |
717 | dq_entry->handle = vrh; | 744 | dq_entry->handle = vrh; |
718 | dq_entry->lookup_attribute = GNUNET_strdup (vrh->issuer_attribute); | 745 | dq_entry->lookup_attribute = GNUNET_strdup (vrh->issuer_attribute); |
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c index 3f6425b42..acb56f2c4 100644 --- a/src/gns/gns_api.c +++ b/src/gns/gns_api.c | |||
@@ -357,6 +357,7 @@ handle_result (void *cls, | |||
357 | GNUNET_CONTAINER_DLL_remove (handle->lookup_head, | 357 | GNUNET_CONTAINER_DLL_remove (handle->lookup_head, |
358 | handle->lookup_tail, | 358 | handle->lookup_tail, |
359 | lr); | 359 | lr); |
360 | GNUNET_free (lr->env); | ||
360 | GNUNET_free (lr); | 361 | GNUNET_free (lr); |
361 | GNUNET_assert (GNUNET_OK == | 362 | GNUNET_assert (GNUNET_OK == |
362 | GNUNET_GNSRECORD_records_deserialize (mlen, | 363 | GNUNET_GNSRECORD_records_deserialize (mlen, |