diff options
author | Amar Tumballi <amar@gluster.com> | 2009-12-04 21:27:15 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-12-05 00:49:22 -0800 |
commit | 3e86687e74bdf4847f3e35063dfb46e9871d6959 (patch) | |
tree | 0b290745116737b146bcca04b9f42838e7e9ecd7 /xlators/protocol/server | |
parent | 89bbaa124af8c54bb7ca8b85ad5d40f0bb754e49 (diff) |
fix crash in server protocol server-connection-destroy
a variable allocated inside a condition was getting reffered outside
the block. If the condition fails, there used to be a crash.
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 439 (crash in server protocol, while destroying connection)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=439
Diffstat (limited to 'xlators/protocol/server')
-rw-r--r-- | xlators/protocol/server/src/server-helpers.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c index 112712e7f..88dada151 100644 --- a/xlators/protocol/server/src/server-helpers.c +++ b/xlators/protocol/server/src/server-helpers.c @@ -831,13 +831,15 @@ server_connection_destroy (xlator_t *this, server_connection_t *conn) } } - state = CALL_STATE (frame); - if (state) - free (state); - STACK_DESTROY (frame->root); + if (frame) { + state = CALL_STATE (frame); + if (state) + free (state); + STACK_DESTROY (frame->root); + } - gf_log (this->name, GF_LOG_INFO, "destroyed connection of %s", - conn->id); + gf_log (this->name, GF_LOG_INFO, "destroyed connection of %s", + conn->id); FREE (conn->id); FREE (conn); |