summaryrefslogtreecommitdiff
path: root/socket.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2022-02-16 16:36:01 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2022-02-16 16:36:01 +0900
commit8de1c191058cb7731ce560ed024d5fd122750630 (patch)
tree9791bf47bb786f9f0de80b2ca322c474fa703cf3 /socket.c
parent3166d85224e74e23851181ac5bd070ca9679ce74 (diff)
downloadrsync-8de1c191058cb7731ce560ed024d5fd122750630.tar.gz
rsync-8de1c191058cb7731ce560ed024d5fd122750630.tar.bz2
rsync-8de1c191058cb7731ce560ed024d5fd122750630.zip
Imported Upstream version 3.2.2upstream/3.2.2
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/socket.c b/socket.c
index ee6fb6c6..c2075adf 100644
--- a/socket.c
+++ b/socket.c
@@ -26,6 +26,7 @@
#include "rsync.h"
#include "itypes.h"
+#include "ifuncs.h"
#ifdef HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
#endif
@@ -248,8 +249,6 @@ int open_socket_out(char *host, int port, const char *bind_addr, int af_hint)
for (res = res0, addr_cnt = 0; res; res = res->ai_next, addr_cnt++) {}
errnos = new_array0(int, addr_cnt);
- if (!errnos)
- out_of_memory("open_socket_out");
s = -1;
/* Try to connect to all addresses for this machine until we get
@@ -354,8 +353,7 @@ int open_socket_out_wrapped(char *host, int port, const char *bind_addr, int af_
len += hlen;
}
f = prog;
- if (!(prog = new_array(char, len)))
- out_of_memory("open_socket_out_wrapped");
+ prog = new_array(char, len);
for (t = prog; *f; f++) {
if (*f == '%') {
switch (*++f) {
@@ -423,8 +421,6 @@ static int *open_socket_in(int type, int port, const char *bind_addr,
socks = new_array(int, maxs + 1);
errmsgs = new_array(char *, maxs);
- if (!socks || !errmsgs)
- out_of_memory("open_socket_in");
/* We may not be able to create the socket, if for example the
* machine knows about IPv6 in the C library, but not in the
@@ -684,9 +680,6 @@ void set_socket_options(int fd, char *options)
options = strdup(options);
- if (!options)
- out_of_memory("set_socket_options");
-
for (tok = strtok(options, " \t,"); tok; tok = strtok(NULL," \t,")) {
int ret=0,i;
int value = 1;