diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-18 16:31:08 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-18 16:31:08 +0000 |
commit | 8f91676bbbc14224bfc5cec98509f84794927f0b (patch) | |
tree | 30a0141427e153845b5ac6400d45d6e0746f529c /src/transport/transport-testing.c | |
parent | 1698944df8b50f470aa8dc6860329a9d43542fcc (diff) | |
download | gnunet-8f91676bbbc14224bfc5cec98509f84794927f0b.tar.gz gnunet-8f91676bbbc14224bfc5cec98509f84794927f0b.zip |
coverity fixes
Diffstat (limited to 'src/transport/transport-testing.c')
-rw-r--r-- | src/transport/transport-testing.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c index 0079bc421..5d0e990f7 100644 --- a/src/transport/transport-testing.c +++ b/src/transport/transport-testing.c | |||
@@ -91,6 +91,7 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
91 | { | 91 | { |
92 | struct PeerContext *p = cls; | 92 | struct PeerContext *p = cls; |
93 | /* Find PeerContext */ | 93 | /* Find PeerContext */ |
94 | GNUNET_assert (p != 0); | ||
94 | GNUNET_assert (p->tth != NULL); | 95 | GNUNET_assert (p->tth != NULL); |
95 | struct PeerContext * p2 = find_peer_context (p->tth, peer); | 96 | struct PeerContext * p2 = find_peer_context (p->tth, peer); |
96 | 97 | ||
@@ -136,8 +137,15 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
136 | { | 137 | { |
137 | struct PeerContext *p = cls; | 138 | struct PeerContext *p = cls; |
138 | /* Find PeerContext */ | 139 | /* Find PeerContext */ |
139 | GNUNET_assert (p->tth != NULL); | 140 | int no = 0; |
140 | struct PeerContext * p2 = find_peer_context (p->tth, peer); | 141 | struct PeerContext * p2 = NULL; |
142 | |||
143 | if (p != NULL) | ||
144 | { | ||
145 | GNUNET_assert (p->tth != NULL); | ||
146 | p2 = find_peer_context (p->tth, peer); | ||
147 | no = p->no; | ||
148 | } | ||
141 | 149 | ||
142 | char * p2_s; | 150 | char * p2_s; |
143 | if (p2 != NULL) | 151 | if (p2 != NULL) |
@@ -147,7 +155,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
147 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", | 155 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", |
148 | "Peers %s disconnected from peer %u (`%s')\n", | 156 | "Peers %s disconnected from peer %u (`%s')\n", |
149 | p2_s, | 157 | p2_s, |
150 | p->no, GNUNET_i2s (&p->id)); | 158 | no , GNUNET_i2s (&p->id)); |
151 | GNUNET_free (p2_s); | 159 | GNUNET_free (p2_s); |
152 | 160 | ||
153 | if (p == NULL) | 161 | if (p == NULL) |