diff options
-rw-r--r-- | clientserver.c | 2 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | rsync.h | 5 | ||||
-rw-r--r-- | syscall.c | 2 |
5 files changed, 14 insertions, 3 deletions
diff --git a/clientserver.c b/clientserver.c index a9a1af58..93deb7e6 100644 --- a/clientserver.c +++ b/clientserver.c @@ -505,7 +505,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) if ((p = strstr(module_dir, "/./")) != NULL) { *p = '\0'; p += 2; - } else if ((p = strdup("/")) == NULL) + } else if ((p = strdup("/")) == NULL) /* MEMORY LEAK */ out_of_memory("rsync_module"); } diff --git a/configure.in b/configure.in index be737096..37ad42c1 100644 --- a/configure.in +++ b/configure.in @@ -969,6 +969,12 @@ if test x"$enable_acl_support" = x"no" -o x"$enable_xattr_support" = x"no" -o x" fi fi +case "$CC" in +checker*) + AC_DEFINE(FORCE_FD_ZERO_MEMSET, 1, [Used to make "checker" understand that FD_ZERO() clears memory.]) + ;; +esac + AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig]) AC_OUTPUT @@ -341,7 +341,7 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, in cmd = rsh_env; if (!cmd) cmd = RSYNC_RSH; - cmd = strdup(cmd); + cmd = strdup(cmd); /* MEMORY LEAK */ if (!cmd) goto oom; @@ -1107,6 +1107,11 @@ size_t strlcat(char *d, const char *s, size_t bufsize); #define MY_GID() getgid() #endif +#ifdef FORCE_FD_ZERO_MEMSET +#undef FD_ZERO +#define FD_ZERO(fdsetp) memset(fdsetp, 0, sizeof (fd_set)) +#endif + extern int verbose; #ifndef HAVE_INET_NTOP @@ -167,7 +167,7 @@ int do_chmod(const char *path, mode_t mode) code = 1; #endif } else - code = chmod(path, mode & CHMOD_BITS); + code = chmod(path, mode & CHMOD_BITS); /* DISCOURAGED FUNCTION */ if (code != 0 && (preserve_perms || preserve_executability)) return code; return 0; |