summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorarao <arao@redhat.com>2015-02-18 13:11:42 +0530
committerVijay Bellur <vbellur@redhat.com>2015-04-02 06:37:53 -0700
commitcf5bf1863d58f823f9c67b0e5dda3ba9261ccf27 (patch)
tree24126eb2286f0f41be14d5048cbc123285bae1d9 /rpc
parentf4be9bc3c530ab35a0cd1939df8c43abe54e540d (diff)
rpc: Fixing dereferencing after null check
CID: 1124607 The pointer variable is checked for NULL and logged accordingly. Change-Id: Ied0d7f7ff33da22198eca65f14816b943cae5541 BUG: 789278 Signed-off-by: arao <arao@redhat.com> Reviewed-on: http://review.gluster.org/9674 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-lib/src/rpcsvc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
index 67b71ea0e8e..5717bedcf17 100644
--- a/rpc/rpc-lib/src/rpcsvc.c
+++ b/rpc/rpc-lib/src/rpcsvc.c
@@ -1531,9 +1531,15 @@ rpcsvc_program_unregister (rpcsvc_t *svc, rpcsvc_program_t *program)
ret = 0;
out:
if (ret == -1) {
- gf_log (GF_RPCSVC, GF_LOG_ERROR, "Program unregistration failed"
- ": %s, Num: %d, Ver: %d, Port: %d", program->progname,
- program->prognum, program->progver, program->progport);
+ if (program) {
+ gf_log (GF_RPCSVC, GF_LOG_ERROR, "Program "
+ "unregistration failed"
+ ": %s, Num: %d, Ver: %d, Port: %d",
+ program->progname, program->prognum,
+ program->progver, program->progport);
+ } else {
+ gf_log (GF_RPCSVC, GF_LOG_ERROR, "Program not found");
+ }
}
return ret;