From 9caba0aa00d522eef79fc10db7142d424dae3599 Mon Sep 17 00:00:00 2001 From: John Jones Date: Thu, 27 Apr 2017 08:14:19 -0500 Subject: [PATCH] Memory fix in tcp_transport_dialer --- conn/tcp_transport_dialer.c | 2 +- test/test_peer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conn/tcp_transport_dialer.c b/conn/tcp_transport_dialer.c index 6715375..3f4b223 100644 --- a/conn/tcp_transport_dialer.c +++ b/conn/tcp_transport_dialer.c @@ -30,7 +30,7 @@ int libp2p_conn_tcp_write(const struct Connection* connection, const char* in, s } struct Connection* libp2p_conn_tcp_dial(const struct TransportDialer* transport_dialer, const struct MultiAddress* addr) { - struct Connection* conn = (struct Connection*) malloc(sizeof(struct Connection*)); + struct Connection* conn = (struct Connection*) malloc(sizeof(struct Connection)); conn->socket_handle = socket_open4(); char* ip; int port = multiaddress_get_ip_port(addr); diff --git a/test/test_peer.h b/test/test_peer.h index fbe17bf..1a6ca48 100644 --- a/test/test_peer.h +++ b/test/test_peer.h @@ -90,7 +90,7 @@ int test_peer_protobuf() { retVal = 1; exit: - multiaddress_free(ma); + //multiaddress_free(ma); libp2p_peer_free(peer); libp2p_peer_free(peer_result); if (protobuf != NULL)