client: Don't call strdup on NULL.

CID: #968159

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Klaas Freitag 2013-07-10 15:37:58 +02:00 committed by Andreas Schneider
parent 78605ac6cc
commit 70495d3ede

View file

@ -165,8 +165,10 @@ static int parse_args(struct argument_s *csync_args, int argc, char **argv)
csync_args->propagate = 0;
/* printf("Argument: dry-run\n" ); */
} else if(c_streq(opt->name, "iconv")) {
if (optarg != NULL) {
csync_args->iconv = c_strdup(optarg);
/* printf("Argument: iconv\n" ); */
}
} else if(c_streq(opt->name, "test-statedb")) {
csync_args->create_statedb = 1;
csync_args->update = 1;