diff options
author | Andrew Bartlett <abartlet@samba.org> | 2001-12-30 10:54:58 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2001-12-30 10:54:58 +0000 |
commit | f6e6c678ad5338264496de43e9e1ab2fe4a28e64 (patch) | |
tree | 21145aeb71e92fb12865142a70a1435a25100da5 /source3/auth/auth_info.c | |
parent | 3e10f9554ba0c3408be7ac859ec299394c2b0295 (diff) | |
download | samba-f6e6c678ad5338264496de43e9e1ab2fe4a28e64.tar.gz samba-f6e6c678ad5338264496de43e9e1ab2fe4a28e64.tar.bz2 samba-f6e6c678ad5338264496de43e9e1ab2fe4a28e64.zip |
Add a pile of doxygen style comments to various parts of Samba. Many of these
probably will never actually be genearted, but I like the style in any case.
Also fix a segfault in 'net rpc' when the login failed and a small memory leak
on failure in the auth_info.c code.
Andrew Bartlett
(This used to be commit 2efae7cc522651c22fb120835bc800645559b63e)
Diffstat (limited to 'source3/auth/auth_info.c')
-rw-r--r-- | source3/auth/auth_info.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/source3/auth/auth_info.c b/source3/auth/auth_info.c index cc13d5a8b9..bdd490d3ef 100644 --- a/source3/auth/auth_info.c +++ b/source3/auth/auth_info.c @@ -21,6 +21,8 @@ #include "includes.h" +/** List of various built-in authenticaion modules */ + const struct auth_init_function builtin_auth_init_functions[] = { { "guest", auth_init_guest }, { "rhosts", auth_init_rhosts }, @@ -38,6 +40,25 @@ const struct auth_init_function builtin_auth_init_functions[] = { }; /*************************************************************************** + Free a linked list of auth methods +***************************************************************************/ + +static void free_auth_methods_list(auth_methods **list) +{ + if (list != NULL) { + while (*list) { + auth_methods *old_head = *list; + if ((*list)->free_private_data) { + (*list)->free_private_data(&((*list)->private_data)); + } + DLIST_REMOVE(*list, *list); + SAFE_FREE(old_head); + } + + } +} + +/*************************************************************************** Make a auth_info struct ***************************************************************************/ @@ -104,7 +125,10 @@ static BOOL make_auth_info_text_list(auth_authsupplied_info **auth_info, char ** } } - make_auth_info_list(auth_info, list); + if (!make_auth_info_list(auth_info, list)) { + free_auth_methods_list(&list); + return False; + } return True; } @@ -210,17 +234,8 @@ BOOL make_auth_info_fixed(auth_authsupplied_info **auth_info, uchar chal[8]) void free_auth_info(auth_authsupplied_info **auth_info) { - auth_methods *list; if (*auth_info != NULL) { - list = (*auth_info)->auth_method_list; - while (list) { - auth_methods *old_head = list; - if (list->free_private_data) { - list->free_private_data(&(list->private_data)); - } - DLIST_REMOVE(list, list); - SAFE_FREE(old_head); - } + free_auth_methods_list(&(*auth_info)->auth_method_list); data_blob_free(&(*auth_info)->challenge); ZERO_STRUCT(**auth_info); |