Attempting to silence some more "checker" warnings.

This commit is contained in:
Wayne Davison
2008-03-17 07:34:22 -07:00
parent 1ba6468f1b
commit aa0e6b9977
5 changed files with 14 additions and 3 deletions

View File

@@ -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");
}

View File

@@ -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

2
main.c
View File

@@ -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;

View File

@@ -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

View File

@@ -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;