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
+2006-03-13 Ken Raeburn <raeburn@mit.edu>
+
+ * 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.
+
2006-03-11 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (autoconf.h): Note location change.
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;
p[count] = sym;
count++;
}
+skip_loop:
newp = realloc(p, (count+1) * sizeof(*p));
if (newp == NULL)
goto realloc_failure;