From 70495d3ede6a3e4d3c6e4aeb51a19ef5b3c42959 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Wed, 10 Jul 2013 15:37:58 +0200 Subject: [PATCH] client: Don't call strdup on NULL. CID: #968159 Reviewed-by: Andreas Schneider --- client/csync_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/csync_client.c b/client/csync_client.c index c3c96f922..3df8118d0 100644 --- a/client/csync_client.c +++ b/client/csync_client.c @@ -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;