aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_indexing.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-04 13:38:39 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-04 13:38:39 +0000
commit091f876f017dee24aaa2b8e92463536f43aff054 (patch)
treee55992126fcf82710b5f780da56db8c581368ab1 /src/fs/gnunet-service-fs_indexing.c
parent3ef47bd5ce7f3ece36230f5132a694436cd9480a (diff)
downloadgnunet-091f876f017dee24aaa2b8e92463536f43aff054.tar.gz
gnunet-091f876f017dee24aaa2b8e92463536f43aff054.zip
handle NULL
Diffstat (limited to 'src/fs/gnunet-service-fs_indexing.c')
-rw-r--r--src/fs/gnunet-service-fs_indexing.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c
index ce3f21cd6..5978e4d66 100644
--- a/src/fs/gnunet-service-fs_indexing.c
+++ b/src/fs/gnunet-service-fs_indexing.c
@@ -538,7 +538,8 @@ GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, uint32_t size,
538 odb = (const struct OnDemandBlock *) data; 538 odb = (const struct OnDemandBlock *) data;
539 off = GNUNET_ntohll (odb->offset); 539 off = GNUNET_ntohll (odb->offset);
540 fn = (const char *) GNUNET_CONTAINER_multihashmap_get (ifm, &odb->file_id); 540 fn = (const char *) GNUNET_CONTAINER_multihashmap_get (ifm, &odb->file_id);
541 if (0 != ACCESS (fn, R_OK)) 541 if ( (NULL == fn) ||
542 (0 != ACCESS (fn, R_OK)) )
542 { 543 {
543 GNUNET_STATISTICS_update (GSF_stats, 544 GNUNET_STATISTICS_update (GSF_stats,
544 gettext_noop ("# index blocks removed: original file inaccessible"), 545 gettext_noop ("# index blocks removed: original file inaccessible"),
@@ -548,9 +549,7 @@ GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, uint32_t size,
548 GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL); 549 GNUNET_TIME_UNIT_FOREVER_REL, &remove_cont, NULL);
549 return GNUNET_SYSERR; 550 return GNUNET_SYSERR;
550 } 551 }
551 fh = NULL; 552 if ((NULL ==
552 if ((NULL == fn) ||
553 (NULL ==
554 (fh = 553 (fh =
555 GNUNET_DISK_file_open (fn, GNUNET_DISK_OPEN_READ, 554 GNUNET_DISK_file_open (fn, GNUNET_DISK_OPEN_READ,
556 GNUNET_DISK_PERM_NONE))) || 555 GNUNET_DISK_PERM_NONE))) ||