[autobackport: sssd-2-9-4] KRB5: fix mem leak in authenticate_stored_users()#8538
[autobackport: sssd-2-9-4] KRB5: fix mem leak in authenticate_stored_users()#8538sssd-bot wants to merge 2 commits intoSSSD:sssd-2-9-4from
authenticate_stored_users()#8538Conversation
There was a problem hiding this comment.
Code Review
This pull request is an automatic backport to fix two memory leaks. The changes in src/providers/krb5/krb5_delayed_online_authentication.c correctly fix a leak by ensuring a hash table is always destroyed. However, the changes for src/util/find_uid.c have introduced a merge conflict. This is a critical issue that prevents compilation and must be resolved before merging. My review provides a specific suggestion to fix the conflict.
| <<<<<<< HEAD | ||
| return get_active_uid_linux(*table, 0); | ||
| #else | ||
| return ENOSYS; | ||
| #endif | ||
| ======= | ||
| ret = get_active_uid(*table, 0); | ||
| if (ret != EOK) { | ||
| hash_destroy(*table); | ||
| *table = NULL; | ||
| } | ||
|
|
||
| return ret; | ||
| >>>>>>> 5b85b647e (UTIL: fix mem leak if `get_active_uid()` fails) |
There was a problem hiding this comment.
This file contains merge conflict markers which must be resolved before this pull request can be merged. The code in its current state will not compile.
The conflict appears to be between a call to get_active_uid_linux in the target branch and a backported change that adds error handling for a call to get_active_uid. You should resolve this by applying the error handling logic to the get_active_uid_linux call.
ret = get_active_uid_linux(*table, 0);
if (ret != EOK) {
hash_destroy(*table);
*table = NULL;
}
return ret;
#else
return ENOSYS;
#endif
This is an automatic backport of PR#8517 KRB5: fix mem leak in
authenticate_stored_users()to branch sssd-2-9-4, created by @alexey-tikhonov.Caution
@alexey-tikhonov The patches did not apply cleanly. It is necessary to resolve conflicts before merging this pull request. Commits that introduced conflict are marked with
CONFLICT!.You can push changes to this pull request
Original commits
74e7bc6 - KRB5: fix mem leak in
authenticate_stored_users()5b85b64 - UTIL: fix mem leak if
get_active_uid()failsBackported commits
authenticate_stored_users()get_active_uid()failsConflicting Files Information (check for deleted and re-added files)
get_active_uid()failsOriginal Pull Request Body