diff options
author | Ken Raeburn <raeburn@mit.edu> | 2006-03-13 21:56:26 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2006-03-13 21:56:26 +0000 |
commit | c3f6e181e266f8469925930600bdaf3601eca321 (patch) | |
tree | c3125913849ef5170eefc908f3ae59a28910a270 /src/util/support/plugins.c | |
parent | 9ea5a3589deff92e64362ce0790f0a4869d19468 (diff) | |
download | krb5-c3f6e181e266f8469925930600bdaf3601eca321.zip krb5-c3f6e181e266f8469925930600bdaf3601eca321.tar.gz krb5-c3f6e181e266f8469925930600bdaf3601eca321.tar.bz2 |
* plugins.c (krb5int_get_plugin_dir_data): If dirhandle is null or the
file pointer is null, return a one-element list containing just NULL.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17738 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/support/plugins.c')
-rw-r--r-- | src/util/support/plugins.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c index 8070db6..c245a70 100644 --- a/src/util/support/plugins.c +++ b/src/util/support/plugins.c @@ -283,17 +283,14 @@ krb5int_get_plugin_dir_data (struct plugin_dir_handle *dirhandle, void **p, **newp, *sym; int count, i, err; - if (dirhandle == NULL) { - *ptrs = 0; - return 0; - } - /* XXX Do we need to add a leading "_" to the symbol name on any modern platforms? */ Tprintf("get_plugin_data_sym(%s)\n", symname); p = 0; count = 0; + if (dirhandle == NULL || dirhandle->files == NULL) + goto skip_loop; for (i = 0; !NULL_HANDLE (&dirhandle->files[i]); i++) { int32_t kerr; sym = NULL; @@ -311,6 +308,7 @@ krb5int_get_plugin_dir_data (struct plugin_dir_handle *dirhandle, p[count] = sym; count++; } +skip_loop: newp = realloc(p, (count+1) * sizeof(*p)); if (newp == NULL) goto realloc_failure; |