Memory fix in tcp_transport_dialer

This commit is contained in:
John Jones 2017-04-27 08:14:19 -05:00
parent f061d03cfa
commit 9caba0aa00
2 changed files with 2 additions and 2 deletions

View file

@ -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* 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(); conn->socket_handle = socket_open4();
char* ip; char* ip;
int port = multiaddress_get_ip_port(addr); int port = multiaddress_get_ip_port(addr);

View file

@ -90,7 +90,7 @@ int test_peer_protobuf() {
retVal = 1; retVal = 1;
exit: exit:
multiaddress_free(ma); //multiaddress_free(ma);
libp2p_peer_free(peer); libp2p_peer_free(peer);
libp2p_peer_free(peer_result); libp2p_peer_free(peer_result);
if (protobuf != NULL) if (protobuf != NULL)