summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRajesh Amaravathi <rajesh@redhat.com>2013-03-21 16:40:16 +0530
committerAnand Avati <avati@redhat.com>2013-04-12 11:31:38 -0700
commitb934b278be2a26a79b3715618ec4c368feb55ad9 (patch)
tree0f90c07e7b853a2ed8a7eb6b6314e1249d603385
parent30b4337d11d361cc8e0122bdb0d2ced09243813a (diff)
rpc-transport: fix glusterd crash when rdma.so missing
Add checks before trying to delete vol_opt from list and free Change-Id: I2858f58518394beb8f74fa477be81d7bdd38304f BUG: 924215 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.org/4704 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4819 Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
-rw-r--r--rpc/rpc-lib/src/rpc-transport.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c
index c146fb63816..cd004dafbd2 100644
--- a/rpc/rpc-lib/src/rpc-transport.c
+++ b/rpc/rpc-lib/src/rpc-transport.c
@@ -339,8 +339,10 @@ fail:
GF_FREE (name);
- list_del_init (&vol_opt->list);
- GF_FREE (vol_opt);
+ if (vol_opt && !list_empty (&vol_opt->list)) {
+ list_del_init (&vol_opt->list);
+ GF_FREE (vol_opt);
+ }
return NULL;
}