diff options
author | anryko <a.shvenke@gmail.com> | 2018-01-05 13:55:28 +0100 |
---|---|---|
committer | anryko <a.shvenke@gmail.com> | 2018-01-05 13:55:28 +0100 |
commit | 48fc70932f0074447d2ab821f2babb5bfe754a1e (patch) | |
tree | 85e2d92e7bde56eaa0fd19b83f8fcf5ad06ecdcc | |
parent | 38afd11738315087eecd71b4d4a3d088ce8e3a30 (diff) | |
download | gnunet-48fc70932f0074447d2ab821f2babb5bfe754a1e.tar.gz gnunet-48fc70932f0074447d2ab821f2babb5bfe754a1e.zip |
Fix potential NULL dereference warning.
-rw-r--r-- | src/set/set_api.c | 5 |
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, | |||
695 | "adding element of type %u to set %p\n", | 695 | "adding element of type %u to set %p\n", |
696 | (unsigned int) element->element_type, | 696 | (unsigned int) element->element_type, |
697 | set); | 697 | set); |
698 | GNUNET_assert (NULL != set); | ||
698 | if (GNUNET_YES == set->invalid) | 699 | if (GNUNET_YES == set->invalid) |
699 | { | 700 | { |
700 | if (NULL != cont) | 701 | if (NULL != cont) |
@@ -772,6 +773,7 @@ GNUNET_SET_destroy (struct GNUNET_SET_Handle *set) | |||
772 | /* destroying set while iterator is active is currently | 773 | /* destroying set while iterator is active is currently |
773 | not supported; we should expand the API to allow | 774 | not supported; we should expand the API to allow |
774 | clients to explicitly cancel the iteration! */ | 775 | clients to explicitly cancel the iteration! */ |
776 | GNUNET_assert (NULL != set); | ||
775 | if ( (NULL != set->ops_head) || | 777 | if ( (NULL != set->ops_head) || |
776 | (NULL != set->iterator) || | 778 | (NULL != set->iterator) || |
777 | (GNUNET_SYSERR == set->destroy_requested) ) | 779 | (GNUNET_SYSERR == set->destroy_requested) ) |
@@ -1124,11 +1126,12 @@ GNUNET_SET_commit (struct GNUNET_SET_OperationHandle *oh, | |||
1124 | { | 1126 | { |
1125 | if (NULL != oh->set) | 1127 | if (NULL != oh->set) |
1126 | { | 1128 | { |
1127 | /* Some other set was already commited for this | 1129 | /* Some other set was already committed for this |
1128 | * operation, there is a logic bug in the client of this API */ | 1130 | * operation, there is a logic bug in the client of this API */ |
1129 | GNUNET_break (0); | 1131 | GNUNET_break (0); |
1130 | return GNUNET_OK; | 1132 | return GNUNET_OK; |
1131 | } | 1133 | } |
1134 | GNUNET_assert (NULL != set); | ||
1132 | if (GNUNET_YES == set->invalid) | 1135 | if (GNUNET_YES == set->invalid) |
1133 | return GNUNET_SYSERR; | 1136 | return GNUNET_SYSERR; |
1134 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1137 | LOG (GNUNET_ERROR_TYPE_DEBUG, |