[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17589 - in gnunet/src: ats transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17589 - in gnunet/src: ats transport |
Date: |
Tue, 18 Oct 2011 18:31:08 +0200 |
Author: wachs
Date: 2011-10-18 18:31:08 +0200 (Tue, 18 Oct 2011)
New Revision: 17589
Modified:
gnunet/src/ats/test_ats_api_bandwidth_consumption.c
gnunet/src/transport/plugin_transport_http_client.c
gnunet/src/transport/plugin_transport_http_server.c
gnunet/src/transport/plugin_transport_udp.c
gnunet/src/transport/test_transport_api.c
gnunet/src/transport/test_transport_startonly.c
gnunet/src/transport/transport-testing.c
Log:
coverity fixes
Modified: gnunet/src/ats/test_ats_api_bandwidth_consumption.c
===================================================================
--- gnunet/src/ats/test_ats_api_bandwidth_consumption.c 2011-10-18 16:28:13 UTC
(rev 17588)
+++ gnunet/src/ats/test_ats_api_bandwidth_consumption.c 2011-10-18 16:31:08 UTC
(rev 17589)
@@ -258,6 +258,8 @@
ret = GNUNET_SYSERR;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to init ATS performance\n");
end_badly(NULL, NULL);
+ GNUNET_free (p);
+ GNUNET_free (addr);
return;
}
Modified: gnunet/src/transport/plugin_transport_http_client.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_client.c 2011-10-18 16:28:13 UTC
(rev 17588)
+++ gnunet/src/transport/plugin_transport_http_client.c 2011-10-18 16:31:08 UTC
(rev 17589)
@@ -405,7 +405,6 @@
GNUNET_NO);
return len;
- client_wake_up(NULL,NULL);
}
/**
Modified: gnunet/src/transport/plugin_transport_http_server.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_server.c 2011-10-18 16:28:13 UTC
(rev 17588)
+++ gnunet/src/transport/plugin_transport_http_server.c 2011-10-18 16:31:08 UTC
(rev 17589)
@@ -145,7 +145,7 @@
GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name,
"CERT_FILE", &cert_file))
{
- cert_file = "https_cert.crt";
+ GNUNET_asprintf(&cert_file, "%s", "https_cert.crt");
}
/* read key & certificates from file */
Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2011-10-18 16:28:13 UTC (rev
17588)
+++ gnunet/src/transport/plugin_transport_udp.c 2011-10-18 16:31:08 UTC (rev
17589)
@@ -681,11 +681,14 @@
}
}
//session_invalid:
+ if ((addr == NULL) && (addrlen == 0))
+ return GNUNET_SYSERR;
peer_session = create_session (plugin, target, addr, addrlen, cont,
cont_cls);
if (peer_session == NULL)
{
if (cont != NULL)
cont (cont_cls, target, GNUNET_SYSERR);
+ return GNUNET_SYSERR;;
}
/* Message */
Modified: gnunet/src/transport/test_transport_api.c
===================================================================
--- gnunet/src/transport/test_transport_api.c 2011-10-18 16:28:13 UTC (rev
17588)
+++ gnunet/src/transport/test_transport_api.c 2011-10-18 16:31:08 UTC (rev
17589)
@@ -150,6 +150,7 @@
t = p1;
if (0 == memcmp (peer, &p2->id, sizeof (struct GNUNET_PeerIdentity)))
t = p2;
+ GNUNET_assert (t != NULL);
char * ps = strdup (GNUNET_i2s(&p->id));
@@ -245,6 +246,7 @@
t = p1;
if (0 == memcmp (peer, &p2->id, sizeof (struct GNUNET_PeerIdentity)))
t = p2;
+ GNUNET_assert (t!=NULL);
char * ps = strdup (GNUNET_i2s(&p->id));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%4s'): peer %u (`%s')
connected to me!\n",
Modified: gnunet/src/transport/test_transport_startonly.c
===================================================================
--- gnunet/src/transport/test_transport_startonly.c 2011-10-18 16:28:13 UTC
(rev 17588)
+++ gnunet/src/transport/test_transport_startonly.c 2011-10-18 16:31:08 UTC
(rev 17589)
@@ -150,7 +150,7 @@
fprintf (stderr, "..%i", i);
}
- GNUNET_TRANSPORT_TESTING_init (tth);
+ tth = GNUNET_TRANSPORT_TESTING_init ();
fprintf (stderr, "\n");
end ();
Modified: gnunet/src/transport/transport-testing.c
===================================================================
--- gnunet/src/transport/transport-testing.c 2011-10-18 16:28:13 UTC (rev
17588)
+++ gnunet/src/transport/transport-testing.c 2011-10-18 16:31:08 UTC (rev
17589)
@@ -91,6 +91,7 @@
{
struct PeerContext *p = cls;
/* Find PeerContext */
+ GNUNET_assert (p != 0);
GNUNET_assert (p->tth != NULL);
struct PeerContext * p2 = find_peer_context (p->tth, peer);
@@ -136,9 +137,16 @@
{
struct PeerContext *p = cls;
/* Find PeerContext */
- GNUNET_assert (p->tth != NULL);
- struct PeerContext * p2 = find_peer_context (p->tth, peer);
+ int no = 0;
+ struct PeerContext * p2 = NULL;
+ if (p != NULL)
+ {
+ GNUNET_assert (p->tth != NULL);
+ p2 = find_peer_context (p->tth, peer);
+ no = p->no;
+ }
+
char * p2_s;
if (p2 != NULL)
GNUNET_asprintf(&p2_s, "%u (`%s')", p2->no, GNUNET_i2s (&p2->id));
@@ -147,7 +155,7 @@
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing",
"Peers %s disconnected from peer %u (`%s')\n",
p2_s,
- p->no, GNUNET_i2s (&p->id));
+ no , GNUNET_i2s (&p->id));
GNUNET_free (p2_s);
if (p == NULL)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17589 - in gnunet/src: ats transport,
gnunet <=