diff options
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 8070db6a5..c245a70db 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; |
