Created
June 18, 2013 19:08
-
-
Save awreece/5808306 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/engines/default_engine/default_engine.c b/engines/default_engine/default_engine.c | |
index e877ecc..89e694b 100644 | |
--- a/engines/default_engine/default_engine.c | |
+++ b/engines/default_engine/default_engine.c | |
@@ -878,16 +878,17 @@ static TAP_ITERATOR default_get_tap_iterator(ENGINE_HANDLE* handle, | |
static void default_handle_disconnect(const void *cookie, | |
ENGINE_EVENT_TYPE type, | |
const void *event_data, | |
const void *cb_data) { | |
struct default_engine *engine = (struct default_engine*)cb_data; | |
pthread_mutex_lock(&engine->tap_connections.lock); | |
int ii; | |
for (ii = 0; ii < engine->tap_connections.size; ++ii) { | |
if (engine->tap_connections.clients[ii] == cookie) { | |
free(engine->server.cookie->get_engine_specific(cookie)); | |
+ engine->tap_connections.clients[ii] = NULL; | |
break; | |
} | |
} | |
pthread_mutex_unlock(&engine->tap_connections.lock); | |
} |
Also, should we clear the engine specific value for the cookie now that it is no longer valid?
engine->server.cookie->set_engine_specific(cookie, NULL)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, the
free
should probably occur outside the lock.