aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_unindex.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-04-23 07:50:10 +0000
committerChristian Grothoff <christian@grothoff.org>2012-04-23 07:50:10 +0000
commit2f77bb2776ad8e33d52418accc7544357122f5ed (patch)
treea1993f51999887608ea3629231080308c85cf712 /src/fs/fs_unindex.c
parent28c9afc07d602f1d04bf60a822350009fa7ade11 (diff)
downloadgnunet-2f77bb2776ad8e33d52418accc7544357122f5ed.tar.gz
gnunet-2f77bb2776ad8e33d52418accc7544357122f5ed.zip
-fixing leaks and error messages
Diffstat (limited to 'src/fs/fs_unindex.c')
-rw-r--r--src/fs/fs_unindex.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index fa71b56bc..a4deb8fa0 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -341,7 +341,7 @@ unindex_directory_scan_cb (void *cls,
341 { 341 {
342 uc->ksk_uri = GNUNET_FS_uri_dup (directory_scan_result->ksk_uri); 342 uc->ksk_uri = GNUNET_FS_uri_dup (directory_scan_result->ksk_uri);
343 uc->state = UNINDEX_STATE_DS_REMOVE_KBLOCKS; 343 uc->state = UNINDEX_STATE_DS_REMOVE_KBLOCKS;
344 uc->emsg = GNUNET_strdup (_("Failed to connect to `datastore' service.")); 344 uc->emsg = GNUNET_strdup (_("Failed to get KSKs from directory scan."));
345 GNUNET_FS_unindex_sync_ (uc); 345 GNUNET_FS_unindex_sync_ (uc);
346 GNUNET_FS_unindex_do_remove_kblocks_ (uc); 346 GNUNET_FS_unindex_do_remove_kblocks_ (uc);
347 } 347 }
@@ -545,7 +545,7 @@ GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc)
545 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub; 545 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub;
546 struct GNUNET_CRYPTO_RsaPrivateKey *pk; 546 struct GNUNET_CRYPTO_RsaPrivateKey *pk;
547 547
548 if (NULL != uc->dsh) 548 if (NULL == uc->dsh)
549 uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg); 549 uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg);
550 if (NULL == uc->dsh) 550 if (NULL == uc->dsh)
551 { 551 {
@@ -610,7 +610,8 @@ unindex_extract_keywords (void *cls, const struct GNUNET_SCHEDULER_TaskContext *
610void 610void
611GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc) 611GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc)
612{ 612{
613 uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg); 613 if (NULL != uc->dsh)
614 uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg);
614 if (NULL == uc->dsh) 615 if (NULL == uc->dsh)
615 { 616 {
616 uc->state = UNINDEX_STATE_ERROR; 617 uc->state = UNINDEX_STATE_ERROR;
@@ -840,6 +841,7 @@ GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc)
840 (uc->state == 841 (uc->state ==
841 UNINDEX_STATE_COMPLETE) ? uc->file_size : 0); 842 UNINDEX_STATE_COMPLETE) ? uc->file_size : 0);
842 GNUNET_break (NULL == uc->client_info); 843 GNUNET_break (NULL == uc->client_info);
844 GNUNET_free_non_null (uc->emsg);
843 GNUNET_free (uc->filename); 845 GNUNET_free (uc->filename);
844 GNUNET_free (uc); 846 GNUNET_free (uc);
845} 847}