-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sources/auth_query.c: improve cleanup on error path #580
base: master
Are you sure you want to change the base?
Conversation
No, we actually need to do this before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also od_client_free
found by Coverity 288error: 289 /* unlock hashmap entry */ 290 od_hashmap_unlock_key(storage->acache, keyhash, &key); CID 486482: (yandex#1 of 1): Missing unlock (LOCK) 8. missing_unlock: Returning without unlocking router->lock. 291 return NOT_OK_RESPONSE;
f5f0c47
to
7981c53
Compare
we need
in line 276 |
@@ -193,6 +193,8 @@ int od_auth_query(od_client_t *client, char *peer) | |||
od_debug(&instance->logger, "auth_query", auth_client, NULL, | |||
"failed to route internal auth query client: %s", | |||
od_router_status_to_str(status)); | |||
od_router_close(router, auth_client); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If client is not routed we cannot close it, no backend connection is assigned
we also cannot unroute non-routed client
full report is
do you mean line 196 ? I do not see issues on 276 |
line 274 |
Coverity is aware of jump from line 196 to line 288. line 274 is outside the scope of this fix (I think that 196 --> 274 jump is low priority because it is part of error path, we do not care much about error path, but Coverity has no idea on that unfortunately) |
found by Coverity