Line 0
Link Here
|
|
|
1 |
--- src/lib/network.cc.orig |
2 |
+++ src/lib/network.cc |
3 |
@@ -6,6 +6,7 @@ |
4 |
#include <cassert> |
5 |
#include <cerrno> |
6 |
#include <csignal> |
7 |
+#include <cstdlib> |
8 |
#include <cstring> |
9 |
#include <new> |
10 |
#include <string> |
11 |
@@ -289,7 +290,7 @@ |
12 |
|
13 |
set_socket_nonblocking(listenfd); |
14 |
|
15 |
- sa = (sockaddr*)std::malloc(MAXSOCKADDR); |
16 |
+ sa = (sockaddr*)malloc(MAXSOCKADDR); |
17 |
if (sa == NULL) |
18 |
throw std::bad_alloc(); |
19 |
} |
20 |
@@ -370,7 +371,7 @@ |
21 |
const size_t MIN_POLLFD = 10; |
22 |
/* allocate more memory for the pollfd array */ |
23 |
fd_alloc = std::max(MIN_POLLFD, 3 * fd_alloc / 2); |
24 |
- pollfd* tmp = (pollfd*)std::realloc(fds, fd_alloc * sizeof *fds); |
25 |
+ pollfd* tmp = (pollfd*)realloc(fds, fd_alloc * sizeof *fds); |
26 |
if (tmp == NULL) |
27 |
throw std::bad_alloc(); |
28 |
|