aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'libtransport/src/core')
-rw-r--r--libtransport/src/core/prefix.cc3
-rw-r--r--libtransport/src/core/tcp_socket_connector.cc2
-rw-r--r--libtransport/src/core/udp_socket_connector.cc2
3 files changed, 4 insertions, 3 deletions
diff --git a/libtransport/src/core/prefix.cc b/libtransport/src/core/prefix.cc
index 59898ab70..30f780461 100644
--- a/libtransport/src/core/prefix.cc
+++ b/libtransport/src/core/prefix.cc
@@ -226,7 +226,7 @@ Name Prefix::getRandomName() const {
ip_prefix_.len;
size_t size = (size_t)ceil((float)addr_len / 8.0);
- uint8_t buffer[size];
+ uint8_t *buffer = (uint8_t *) malloc(sizeof(uint8_t) * size);
RAND_bytes(buffer, size);
@@ -237,6 +237,7 @@ Name Prefix::getRandomName() const {
name_ip_buffer[i] = buffer[j];
j++;
}
+ free(buffer);
return Name(ip_prefix_.family, (uint8_t *)&name_ip);
}
diff --git a/libtransport/src/core/tcp_socket_connector.cc b/libtransport/src/core/tcp_socket_connector.cc
index 58df8fb08..20b3d6ce6 100644
--- a/libtransport/src/core/tcp_socket_connector.cc
+++ b/libtransport/src/core/tcp_socket_connector.cc
@@ -15,7 +15,7 @@
#include <core/tcp_socket_connector.h>
#ifdef _WIN32
-#include <portability/win_portability.h>
+#include <hicn/transport/portability/win_portability.h>
#endif
#include <hicn/transport/errors/errors.h>
diff --git a/libtransport/src/core/udp_socket_connector.cc b/libtransport/src/core/udp_socket_connector.cc
index ec59c2e64..f5ddd6270 100644
--- a/libtransport/src/core/udp_socket_connector.cc
+++ b/libtransport/src/core/udp_socket_connector.cc
@@ -14,7 +14,7 @@
*/
#ifdef _WIN32
-#include <portability/win_portability.h>
+#include <hicn/transport/portability/win_portability.h>
#endif
#include <hicn/transport/errors/errors.h>