summaryrefslogtreecommitdiff
path: root/src/set
diff options
context:
space:
mode:
authoranryko <a.shvenke@gmail.com>2018-01-05 13:55:28 +0100
committeranryko <a.shvenke@gmail.com>2018-01-05 13:55:28 +0100
commit48fc70932f0074447d2ab821f2babb5bfe754a1e (patch)
tree85e2d92e7bde56eaa0fd19b83f8fcf5ad06ecdcc /src/set
parent38afd11738315087eecd71b4d4a3d088ce8e3a30 (diff)
Fix potential NULL dereference warning.
Diffstat (limited to 'src/set')
-rw-r--r--src/set/set_api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/set/set_api.c b/src/set/set_api.c
index 1d0d00b44..cefc6734a 100644
--- a/src/set/set_api.c
+++ b/src/set/set_api.c
@@ -695,6 +695,7 @@ GNUNET_SET_add_element (struct GNUNET_SET_Handle *set,
"adding element of type %u to set %p\n",
(unsigned int) element->element_type,
set);
+ GNUNET_assert (NULL != set);
if (GNUNET_YES == set->invalid)
{
if (NULL != cont)
@@ -772,6 +773,7 @@ GNUNET_SET_destroy (struct GNUNET_SET_Handle *set)
/* destroying set while iterator is active is currently
not supported; we should expand the API to allow
clients to explicitly cancel the iteration! */
+ GNUNET_assert (NULL != set);
if ( (NULL != set->ops_head) ||
(NULL != set->iterator) ||
(GNUNET_SYSERR == set->destroy_requested) )
@@ -1124,11 +1126,12 @@ GNUNET_SET_commit (struct GNUNET_SET_OperationHandle *oh,
{
if (NULL != oh->set)
{
- /* Some other set was already commited for this
+ /* Some other set was already committed for this
* operation, there is a logic bug in the client of this API */
GNUNET_break (0);
return GNUNET_OK;
}
+ GNUNET_assert (NULL != set);
if (GNUNET_YES == set->invalid)
return GNUNET_SYSERR;
LOG (GNUNET_ERROR_TYPE_DEBUG,