aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2023-10-25 14:57:45 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2023-10-25 14:57:45 +0200
commit99118ccc8214ea2ac3566bbe1e4fb81258f5b056 (patch)
treef47e6aaf0527f38ffa5a2a493cd824b334ff01e2
parent301de32f0f5e0664f5038c745ff044ef91d75630 (diff)
downloadgnunet-99118ccc8214ea2ac3566bbe1e4fb81258f5b056.tar.gz
gnunet-99118ccc8214ea2ac3566bbe1e4fb81258f5b056.zip
TRANSPORT/HOSTLIST: Fix crashing services; code smells still exist
-rw-r--r--src/service/hostlist/gnunet-daemon-hostlist_client.c5
-rw-r--r--src/service/transport/gnunet-service-transport.c4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/service/hostlist/gnunet-daemon-hostlist_client.c b/src/service/hostlist/gnunet-daemon-hostlist_client.c
index 483233fc6..3f963332d 100644
--- a/src/service/hostlist/gnunet-daemon-hostlist_client.c
+++ b/src/service/hostlist/gnunet-daemon-hostlist_client.c
@@ -415,7 +415,8 @@ callback_download (void *ptr, size_t size, size_t nmemb, void *ctx)
415 msg, 415 msg,
416 shc_cont, 416 shc_cont,
417 NULL); 417 NULL);
418 GNUNET_CONTAINER_DLL_insert (shc_head, shc_tail, shc); 418 if (NULL != shc)
419 GNUNET_CONTAINER_DLL_insert (shc_head, shc_tail, shc);
419 memmove (download_buffer, &download_buffer[msize], download_pos - msize); 420 memmove (download_buffer, &download_buffer[msize], download_pos - msize);
420 download_pos -= msize; 421 download_pos -= msize;
421 } 422 }
@@ -1753,7 +1754,7 @@ void
1753GNUNET_HOSTLIST_client_stop () 1754GNUNET_HOSTLIST_client_stop ()
1754{ 1755{
1755 struct GNUNET_PEERSTORE_StoreHelloContext *pos; 1756 struct GNUNET_PEERSTORE_StoreHelloContext *pos;
1756 1757
1757 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist client shutdown\n"); 1758 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist client shutdown\n");
1758 while (NULL != (pos = shc_head)) 1759 while (NULL != (pos = shc_head))
1759 { 1760 {
diff --git a/src/service/transport/gnunet-service-transport.c b/src/service/transport/gnunet-service-transport.c
index a1848fbb1..a09eac11e 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -3892,6 +3892,8 @@ free_address_list_entry (struct AddressListEntry *ale)
3892 GNUNET_SCHEDULER_cancel (ale->st); 3892 GNUNET_SCHEDULER_cancel (ale->st);
3893 ale->st = NULL; 3893 ale->st = NULL;
3894 } 3894 }
3895 if (NULL != ale->signed_address)
3896 GNUNET_free (ale->signed_address);
3895 GNUNET_free (ale); 3897 GNUNET_free (ale);
3896} 3898}
3897 3899
@@ -5506,8 +5508,6 @@ shc_cont (void *cls, int success)
5506 GNUNET_PEERSTORE_STOREOPTION_MULTIPLE, 5508 GNUNET_PEERSTORE_STOREOPTION_MULTIPLE,
5507 &peerstore_store_own_cb, 5509 &peerstore_store_own_cb,
5508 ale); 5510 ale);
5509 GNUNET_free (ale->signed_address);
5510 GNUNET_free (ale);
5511} 5511}
5512 5512
5513 5513