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 | |
parent | 1698944df8b50f470aa8dc6860329a9d43542fcc (diff) | |
download | gnunet-8f91676bbbc14224bfc5cec98509f84794927f0b.tar.gz gnunet-8f91676bbbc14224bfc5cec98509f84794927f0b.zip |
coverity fixes
-rw-r--r-- | src/ats/test_ats_api_bandwidth_consumption.c | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_client.c | 1 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_udp.c | 3 | ||||
-rw-r--r-- | src/transport/test_transport_api.c | 2 | ||||
-rw-r--r-- | src/transport/test_transport_startonly.c | 2 | ||||
-rw-r--r-- | src/transport/transport-testing.c | 14 |
7 files changed, 20 insertions, 6 deletions
diff --git a/src/ats/test_ats_api_bandwidth_consumption.c b/src/ats/test_ats_api_bandwidth_consumption.c index 05a3e257a..d2a7b53dc 100644 --- a/src/ats/test_ats_api_bandwidth_consumption.c +++ b/src/ats/test_ats_api_bandwidth_consumption.c | |||
@@ -258,6 +258,8 @@ check (void *cls, char *const *args, const char *cfgfile, | |||
258 | ret = GNUNET_SYSERR; | 258 | ret = GNUNET_SYSERR; |
259 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to init ATS performance\n"); | 259 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to init ATS performance\n"); |
260 | end_badly(NULL, NULL); | 260 | end_badly(NULL, NULL); |
261 | GNUNET_free (p); | ||
262 | GNUNET_free (addr); | ||
261 | return; | 263 | return; |
262 | } | 264 | } |
263 | 265 | ||
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index c116a9d77..a2024953c 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c | |||
@@ -405,7 +405,6 @@ client_receive (void *stream, size_t size, size_t nmemb, void *cls) | |||
405 | GNUNET_NO); | 405 | GNUNET_NO); |
406 | 406 | ||
407 | return len; | 407 | return len; |
408 | client_wake_up(NULL,NULL); | ||
409 | } | 408 | } |
410 | 409 | ||
411 | /** | 410 | /** |
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 4ae0df35a..c1c35d4ba 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -145,7 +145,7 @@ server_load_certificate (struct Plugin *plugin) | |||
145 | GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name, | 145 | GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name, |
146 | "CERT_FILE", &cert_file)) | 146 | "CERT_FILE", &cert_file)) |
147 | { | 147 | { |
148 | cert_file = "https_cert.crt"; | 148 | GNUNET_asprintf(&cert_file, "%s", "https_cert.crt"); |
149 | } | 149 | } |
150 | 150 | ||
151 | /* read key & certificates from file */ | 151 | /* read key & certificates from file */ |
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index f4a806723..ddb6187e5 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -681,11 +681,14 @@ udp_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, | |||
681 | } | 681 | } |
682 | } | 682 | } |
683 | //session_invalid: | 683 | //session_invalid: |
684 | if ((addr == NULL) && (addrlen == 0)) | ||
685 | return GNUNET_SYSERR; | ||
684 | peer_session = create_session (plugin, target, addr, addrlen, cont, cont_cls); | 686 | peer_session = create_session (plugin, target, addr, addrlen, cont, cont_cls); |
685 | if (peer_session == NULL) | 687 | if (peer_session == NULL) |
686 | { | 688 | { |
687 | if (cont != NULL) | 689 | if (cont != NULL) |
688 | cont (cont_cls, target, GNUNET_SYSERR); | 690 | cont (cont_cls, target, GNUNET_SYSERR); |
691 | return GNUNET_SYSERR;; | ||
689 | } | 692 | } |
690 | 693 | ||
691 | /* Message */ | 694 | /* Message */ |
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c index 81a0b39e1..6b6cc0c0e 100644 --- a/src/transport/test_transport_api.c +++ b/src/transport/test_transport_api.c | |||
@@ -150,6 +150,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
150 | t = p1; | 150 | t = p1; |
151 | if (0 == memcmp (peer, &p2->id, sizeof (struct GNUNET_PeerIdentity))) | 151 | if (0 == memcmp (peer, &p2->id, sizeof (struct GNUNET_PeerIdentity))) |
152 | t = p2; | 152 | t = p2; |
153 | GNUNET_assert (t != NULL); | ||
153 | 154 | ||
154 | char * ps = strdup (GNUNET_i2s(&p->id)); | 155 | char * ps = strdup (GNUNET_i2s(&p->id)); |
155 | 156 | ||
@@ -245,6 +246,7 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
245 | t = p1; | 246 | t = p1; |
246 | if (0 == memcmp (peer, &p2->id, sizeof (struct GNUNET_PeerIdentity))) | 247 | if (0 == memcmp (peer, &p2->id, sizeof (struct GNUNET_PeerIdentity))) |
247 | t = p2; | 248 | t = p2; |
249 | GNUNET_assert (t!=NULL); | ||
248 | 250 | ||
249 | char * ps = strdup (GNUNET_i2s(&p->id)); | 251 | char * ps = strdup (GNUNET_i2s(&p->id)); |
250 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%4s'): peer %u (`%s') connected to me!\n", | 252 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%4s'): peer %u (`%s') connected to me!\n", |
diff --git a/src/transport/test_transport_startonly.c b/src/transport/test_transport_startonly.c index 721154f9e..1349a0c4d 100644 --- a/src/transport/test_transport_startonly.c +++ b/src/transport/test_transport_startonly.c | |||
@@ -150,7 +150,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
150 | fprintf (stderr, "..%i", i); | 150 | fprintf (stderr, "..%i", i); |
151 | } | 151 | } |
152 | 152 | ||
153 | GNUNET_TRANSPORT_TESTING_init (tth); | 153 | tth = GNUNET_TRANSPORT_TESTING_init (); |
154 | 154 | ||
155 | fprintf (stderr, "\n"); | 155 | fprintf (stderr, "\n"); |
156 | end (); | 156 | end (); |
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) |