summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
diff options
context:
space:
mode:
authorIraj Jamali <ijamali@redhat.com>2018-10-10 12:29:21 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-10-12 03:17:32 +0000
commit33eefcec0ad2df3d6aac0ac225b64c61d42e56ef (patch)
treef4a6cbb09482b62f7448f3a30021b580ccabf719 /xlators/mgmt/glusterd/src/glusterd-geo-rep.c
parent522dcab94ae9938c072cf50062b507cedafdc011 (diff)
mgmt/glusterd: clang fix
Argument with 'nonnull' attribute passed null. Added checks to avoid the issues. Updates: bz#1622665 Change-Id: I0dba1185cee5baba3c124d687560a06fe182381e Signed-off-by: Iraj Jamali <ijamali@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-geo-rep.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index c8a4be2cdea..dedd243c2dd 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -4211,8 +4211,8 @@ glusterd_gsync_op_already_set(char *master, char *slave, char *conf_path,
}
if (is_bool) {
- if (!strcmp(op_value, "true") || !strcmp(op_value, "1") ||
- !strcmp(op_value, "yes")) {
+ if (op_value && (!strcmp(op_value, "true") || !strcmp(op_value, "1") ||
+ !strcmp(op_value, "yes"))) {
op_val_cli = 1;
} else {
op_val_cli = 0;
@@ -4223,7 +4223,7 @@ glusterd_gsync_op_already_set(char *master, char *slave, char *conf_path,
goto out;
}
} else {
- if (!strcmp(op_val_buf, op_value)) {
+ if (op_value && !strcmp(op_val_buf, op_value)) {
ret = 0;
goto out;
}