X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/ad77db8b713d194c46f8cee1781f7a5ab7635c7e..d3ef985954a2b79aaca4be17728cb541345157bf:/options.c diff --git a/options.c b/options.c index ee7b5222..a80da6aa 100644 --- a/options.c +++ b/options.c @@ -893,12 +893,15 @@ int parse_arguments(int *argc, const char ***argv, int frommain) if (sanitize_paths) arg = sanitize_path(NULL, arg, NULL, 0); if (server_filter_list.head) { - char *cp = (char *)arg; + char *cp = strdup(arg); + if (!cp) + out_of_memory("parse_arguments"); if (!*cp) goto options_rejected; clean_fname(cp, 1); if (check_filter(&server_filter_list, cp, 0) < 0) goto options_rejected; + free(cp); } parse_filter_file(&filter_list, arg, opt == OPT_INCLUDE_FROM ? MATCHFLG_INCLUDE : 0, @@ -1215,7 +1218,6 @@ int parse_arguments(int *argc, const char ***argv, int frommain) } if (server_filter_list.head && !am_sender) { struct filter_list_struct *elp = &server_filter_list; - int i; if (tmpdir) { if (!*tmpdir) goto options_rejected; @@ -1228,13 +1230,6 @@ int parse_arguments(int *argc, const char ***argv, int frommain) if (check_filter(elp, partial_dir, 1) < 0) goto options_rejected; } - for (i = 0; i < basis_dir_cnt; i++) { - if (!*basis_dir[i]) - goto options_rejected; - clean_fname(basis_dir[i], 1); - if (check_filter(elp, basis_dir[i], 1) < 0) - goto options_rejected; - } if (backup_dir) { if (!*backup_dir) goto options_rejected;