From: Christian Grothoff Date: Fri, 7 May 2010 23:42:28 +0000 (+0000) Subject: stuff X-Git-Tag: initial-import-from-subversion-38251~21814 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bfa8316970a7dce659585a038458bc41776ed965;p=oweals%2Fgnunet.git stuff --- diff --git a/src/datastore/Makefile.am b/src/datastore/Makefile.am index e572eafd0..a3882d676 100644 --- a/src/datastore/Makefile.am +++ b/src/datastore/Makefile.am @@ -32,7 +32,6 @@ bin_PROGRAMS = \ gnunet_service_datastore_SOURCES = \ gnunet-service-datastore.c plugin_datastore.h gnunet_service_datastore_LDADD = \ - $(top_builddir)/src/arm/libgnunetarm.la \ $(top_builddir)/src/statistics/libgnunetstatistics.la \ $(top_builddir)/src/util/libgnunetutil.la \ $(GN_LIBINTL) diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 6d0f29671..fc0587cf7 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c @@ -26,7 +26,6 @@ #include "platform.h" #include "gnunet_util_lib.h" -#include "gnunet_arm_service.h" #include "gnunet_protocols.h" #include "gnunet_statistics_service.h" #include "plugin_datastore.h" @@ -1304,7 +1303,6 @@ unload_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_CONTAINER_bloomfilter_free (filter); filter = NULL; } - GNUNET_ARM_stop_services (cfg, tc->sched, "statistics", NULL); if (stats != NULL) { GNUNET_STATISTICS_destroy (stats, GNUNET_YES); @@ -1453,13 +1451,11 @@ run (void *cls, } return; } - GNUNET_ARM_start_services (cfg, sched, "statistics", NULL); plugin = load_plugin (); if (NULL == plugin) { GNUNET_CONTAINER_bloomfilter_free (filter); filter = NULL; - GNUNET_ARM_stop_services (cfg, sched, "statistics", NULL); if (stats != NULL) { GNUNET_STATISTICS_destroy (stats, GNUNET_YES); diff --git a/src/fs/fs.c b/src/fs/fs.c index d2ac711f2..34850f14c 100644 --- a/src/fs/fs.c +++ b/src/fs/fs.c @@ -880,6 +880,7 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h, ret->data.file.reader_cls = GNUNET_FS_make_file_reader_context_ (ret->filename); break; case 4: /* directory */ + ret->is_directory = GNUNET_YES; if ( (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dsize)) || (NULL == (ret->data.dir.dir_data = GNUNET_malloc_large (dsize))) || @@ -892,7 +893,6 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h, goto cleanup; } ret->data.dir.dir_size = (uint32_t) dsize; - ret->is_directory = GNUNET_YES; if (filename != NULL) { ret->data.dir.entries = deserialize_file_information (h, filename); @@ -1451,6 +1451,8 @@ deserialize_publish_file (void *cls, pc->fi_pos = pc->fi; } } + GNUNET_free (fi_root); + fi_root = NULL; /* generate RESUME event(s) */ GNUNET_FS_file_information_inspect (pc->fi, &fip_signal_resume, diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 6d3f4679d..be2994176 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c @@ -149,6 +149,7 @@ ds_put_cont (void *cls, /* we were aborted in the meantime, finish shutdown! */ publish_cleanup (pcc->sc); + GNUNET_free (pcc); return; } GNUNET_assert (GNUNET_YES == pcc->sc->in_network_wait); @@ -1587,6 +1588,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, memcpy (dest, update, nidlen); dest += nidlen; memcpy (dest, uris, slen); + GNUNET_free (uris); dest += slen; mdsize = GNUNET_CONTAINER_meta_data_serialize (mmeta, &dest, @@ -1596,7 +1598,6 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, if (mdsize == -1) { GNUNET_break (0); - GNUNET_free (uris); GNUNET_free (sb); cont (cont_cls, NULL, diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 171eebf4b..af405bfc0 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c @@ -529,6 +529,7 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc, sc->options, NULL, sr); + GNUNET_free (uu.data.sks.identifier); } @@ -1308,6 +1309,7 @@ GNUNET_FS_search_signal_suspend_ (void *cls) GNUNET_free_non_null (sc->requests); GNUNET_free_non_null (sc->emsg); GNUNET_FS_uri_destroy (sc->uri); + GNUNET_free_non_null (sc->serialization); GNUNET_free (sc); } @@ -1474,6 +1476,7 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc) ? GNUNET_FS_SYNC_PATH_CHILD_SEARCH : GNUNET_FS_SYNC_PATH_MASTER_SEARCH, sc->serialization); + GNUNET_free (sc->serialization); } pi.status = GNUNET_FS_STATUS_SEARCH_STOPPED; sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc); diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c index 3e59d92be..d39a630db 100644 --- a/src/fs/test_fs_publish_persistence.c +++ b/src/fs/test_fs_publish_persistence.c @@ -390,10 +390,16 @@ main (int argc, char *argv[]) "nohelp", options, &run, NULL); stop_arm (&p1); GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-publish/"); - GNUNET_DISK_directory_remove (fn1); - GNUNET_free_non_null (fn1); - GNUNET_DISK_directory_remove (fn2); - GNUNET_free_non_null (fn2); + if (fn1 != NULL) + { + GNUNET_DISK_directory_remove (fn1); + GNUNET_free (fn1); + } + if (fn2 != NULL) + { + GNUNET_DISK_directory_remove (fn2); + GNUNET_free (fn2); + } return err; } diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c index 861685d32..81beb3382 100644 --- a/src/fs/test_fs_unindex.c +++ b/src/fs/test_fs_unindex.c @@ -310,8 +310,11 @@ main (int argc, char *argv[]) "nohelp", options, &run, NULL); stop_arm (&p1); GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-unindex/"); - GNUNET_DISK_directory_remove (fn); - GNUNET_free_non_null (fn); + if (NULL != fn) + { + GNUNET_DISK_directory_remove (fn); + GNUNET_free (fn); + } return 0; } diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c index 2185be21d..9bf617ba2 100644 --- a/src/fs/test_fs_unindex_persistence.c +++ b/src/fs/test_fs_unindex_persistence.c @@ -375,8 +375,11 @@ main (int argc, char *argv[]) "nohelp", options, &run, NULL); stop_arm (&p1); GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-unindex/"); - GNUNET_DISK_directory_remove (fn); - GNUNET_free_non_null (fn); + if (NULL != fn) + { + GNUNET_DISK_directory_remove (fn); + GNUNET_free (fn); + } return 0; } diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index 48b038cfe..523b9eb5f 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c @@ -556,6 +556,7 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, h->action_tail = NULL; } } + h->do_destroy = GNUNET_YES; if ( (h->current != NULL) && (h->th == NULL) ) { @@ -567,8 +568,8 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, &transmit_action, h); GNUNET_assert (NULL != h->th); } - h->do_destroy = GNUNET_YES; - return; + if (h->th != NULL) + return; } if (NULL != h->th) { diff --git a/src/util/connection.c b/src/util/connection.c index 4a54aed1d..a877e06c2 100644 --- a/src/util/connection.c +++ b/src/util/connection.c @@ -539,9 +539,14 @@ destroy_continuation (void *cls, notify (sock->nth.notify_ready_cls, 0, NULL); } - if ((sock->sock != NULL) && (sock->persist != GNUNET_YES)) - GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock->sock)); - + if (sock->sock != NULL) + { + if (sock->persist != GNUNET_YES) + GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (sock->sock)); + else + GNUNET_free (sock->sock); /* at least no memory leak (we deliberately + leak the socket in this special case) ... */ + } GNUNET_free_non_null (sock->addr); GNUNET_free_non_null (sock->hostname); #if DEBUG_CONNECTION