do not dereference NULL pointer modules if we do not have dlopen
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:

committed by
Jeffrey Altman

parent
1c8cae58cc
commit
d99b8acd1c
@@ -538,7 +538,7 @@ _krb5_plugin_run_f(krb5_context context,
|
|||||||
krb5_error_code (KRB5_LIB_CALL *func)(krb5_context, const void *, void *, void *))
|
krb5_error_code (KRB5_LIB_CALL *func)(krb5_context, const void *, void *, void *))
|
||||||
{
|
{
|
||||||
heim_string_t m = heim_string_create(module);
|
heim_string_t m = heim_string_create(module);
|
||||||
heim_dict_t dict;
|
heim_dict_t dict = NULL;
|
||||||
void *plug_ctx;
|
void *plug_ctx;
|
||||||
struct common_plugin_method *cpm;
|
struct common_plugin_method *cpm;
|
||||||
struct iter_ctx s;
|
struct iter_ctx s;
|
||||||
@@ -561,7 +561,9 @@ _krb5_plugin_run_f(krb5_context context,
|
|||||||
s.ret = KRB5_PLUGIN_NO_HANDLE;
|
s.ret = KRB5_PLUGIN_NO_HANDLE;
|
||||||
|
|
||||||
/* Get loaded plugins */
|
/* Get loaded plugins */
|
||||||
|
if (modules)
|
||||||
dict = heim_dict_copy_value(modules, m);
|
dict = heim_dict_copy_value(modules, m);
|
||||||
|
|
||||||
heim_release(m);
|
heim_release(m);
|
||||||
|
|
||||||
/* Add loaded plugins to s.result array */
|
/* Add loaded plugins to s.result array */
|
||||||
@@ -603,6 +605,7 @@ _krb5_plugin_run_f(krb5_context context,
|
|||||||
|
|
||||||
heim_release(s.result);
|
heim_release(s.result);
|
||||||
heim_release(s.n);
|
heim_release(s.n);
|
||||||
|
if (dict)
|
||||||
heim_release(dict);
|
heim_release(dict);
|
||||||
|
|
||||||
return s.ret;
|
return s.ret;
|
||||||
|
Reference in New Issue
Block a user