diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-05-16 18:03:40 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-05-16 18:03:40 +0000 |
commit | 4fbfb9eb56f96eac68ee3a4c38ebf2df358ab59d (patch) | |
tree | bae1e2b44dd0039104275d6a37a6b11f08c643a9 | |
parent | 995ab33daff007daba635d91c627b83ada83ef10 (diff) | |
download | gnunet-4fbfb9eb56f96eac68ee3a4c38ebf2df358ab59d.tar.gz gnunet-4fbfb9eb56f96eac68ee3a4c38ebf2df358ab59d.zip |
- avoid double free
-rw-r--r-- | src/mesh/gnunet-service-mesh-new.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mesh/gnunet-service-mesh-new.c b/src/mesh/gnunet-service-mesh-new.c index 0b99e0c0a..d5c356d42 100644 --- a/src/mesh/gnunet-service-mesh-new.c +++ b/src/mesh/gnunet-service-mesh-new.c | |||
@@ -1488,6 +1488,7 @@ peer_info_add_path (struct MeshPeerInfo *peer_info, struct MeshPeerPath *path, | |||
1488 | * | 1488 | * |
1489 | * @param peer_info Peer to add the path to, being the origin of the path. | 1489 | * @param peer_info Peer to add the path to, being the origin of the path. |
1490 | * @param path New path to add after being inversed. | 1490 | * @param path New path to add after being inversed. |
1491 | * Path will be either used or freed. | ||
1491 | * @param trusted Do we trust that this path is real? | 1492 | * @param trusted Do we trust that this path is real? |
1492 | */ | 1493 | */ |
1493 | static void | 1494 | static void |
@@ -3052,14 +3053,12 @@ handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3052 | GNUNET_PEER_change_rc(t->next_hop, 1); | 3053 | GNUNET_PEER_change_rc(t->next_hop, 1); |
3053 | 3054 | ||
3054 | /* It's for somebody else! Retransmit. */ | 3055 | /* It's for somebody else! Retransmit. */ |
3055 | path2 = path_duplicate (path); | ||
3056 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Retransmitting.\n"); | 3056 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Retransmitting.\n"); |
3057 | peer_info_add_path (dest_peer_info, path2, GNUNET_NO); | ||
3058 | path2 = path_duplicate (path); | 3057 | path2 = path_duplicate (path); |
3059 | peer_info_add_path_to_origin (orig_peer_info, path2, GNUNET_NO); | 3058 | peer_info_add_path (dest_peer_info, path2, GNUNET_NO); |
3059 | peer_info_add_path_to_origin (orig_peer_info, path, GNUNET_NO); | ||
3060 | send_create_path (t); | 3060 | send_create_path (t); |
3061 | } | 3061 | } |
3062 | path_destroy (path); | ||
3063 | return GNUNET_OK; | 3062 | return GNUNET_OK; |
3064 | } | 3063 | } |
3065 | 3064 | ||