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. 6
      src/connector.c

6
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); ck_wlock(&cdata->lock);
HASH_FIND_I64(cdata->clients, &id, client); HASH_FIND_I64(cdata->clients, &id, client);
if (client && !client->invalid) if (client) {
if (!client->invalid)
__inc_instance_ref(client); __inc_instance_ref(client);
else
client = NULL;
}
ck_wunlock(&cdata->lock); ck_wunlock(&cdata->lock);
return client; return client;

Loading…
Cancel
Save