diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-31 11:48:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-31 11:48:52 +0000 |
commit | 2b04b0ebddd5d221d2ce8452fb268edc6d477f2d (patch) | |
tree | bc6489cf3a8fede49cb932b7441fc7494b6e39dc /src/mesh | |
parent | 4beecb7f68aa61b61740c60716b0d6050bde41b6 (diff) | |
download | gnunet-2b04b0ebddd5d221d2ce8452fb268edc6d477f2d.tar.gz gnunet-2b04b0ebddd5d221d2ce8452fb268edc6d477f2d.zip |
handle NULL better
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index fd37bb85e..2e9917c3f 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -1503,21 +1503,23 @@ path_add_to_peer (struct MeshPeerInfo *peer_info, struct MeshPeerPath *path) | |||
1503 | unsigned int l; | 1503 | unsigned int l; |
1504 | unsigned int l2; | 1504 | unsigned int l2; |
1505 | 1505 | ||
1506 | #if MESH_DEBUG | 1506 | if ((NULL == peer_info) || (NULL == path)) |
1507 | struct GNUNET_PeerIdentity id; | ||
1508 | |||
1509 | GNUNET_PEER_resolve (peer_info->id, &id); | ||
1510 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1511 | "MESH: adding path [%u] to peer %s\n", | ||
1512 | path->length, | ||
1513 | GNUNET_i2s (&id)); | ||
1514 | #endif | ||
1515 | if (NULL == peer_info || NULL == path) | ||
1516 | { | 1507 | { |
1517 | GNUNET_break (0); | 1508 | GNUNET_break (0); |
1518 | path_destroy (path); | 1509 | path_destroy (path); |
1519 | return; | 1510 | return; |
1520 | } | 1511 | } |
1512 | #if MESH_DEBUG | ||
1513 | { | ||
1514 | struct GNUNET_PeerIdentity id; | ||
1515 | |||
1516 | GNUNET_PEER_resolve (peer_info->id, &id); | ||
1517 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1518 | "MESH: adding path [%u] to peer %s\n", | ||
1519 | path->length, | ||
1520 | GNUNET_i2s (&id)); | ||
1521 | } | ||
1522 | #endif | ||
1521 | 1523 | ||
1522 | l = path_get_length (path); | 1524 | l = path_get_length (path); |
1523 | if (0 == l) | 1525 | if (0 == l) |