Browse Source

Don't return client if it is invalid in ref_client_by_id in the connector

master
Con Kolivas 10 years ago
parent
commit
ec39117a1c
  1. 8
      src/connector.c

8
src/connector.c

@ -435,8 +435,12 @@ static client_instance_t *ref_client_by_id(cdata_t *cdata, int64_t id)
ck_wlock(&cdata->lock);
HASH_FIND_I64(cdata->clients, &id, client);
if (client && !client->invalid)
__inc_instance_ref(client);
if (client) {
if (!client->invalid)
__inc_instance_ref(client);
else
client = NULL;
}
ck_wunlock(&cdata->lock);
return client;

Loading…
Cancel
Save