X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fmodule.c;h=d6e1a4b392308b5f07cf8e2ca33a5f97b7d7c4ea;hb=93abccdee3bfba64079dce8ba6f2e13cd117059f;hp=2dd747458d605f25b2539437d82df571e20083da;hpb=0491710fa74abac1b56db13a013e828bafe3948e;p=openldap diff --git a/servers/slapd/module.c b/servers/slapd/module.c index 2dd747458d..d6e1a4b392 100644 --- a/servers/slapd/module.c +++ b/servers/slapd/module.c @@ -242,7 +242,7 @@ static int module_unload (module_loaded_t *module) } /* call module's terminate routine, if present */ - if (terminate = lt_dlsym(module->lib, "term_module")) { + if ((terminate = lt_dlsym(module->lib, "term_module"))) { terminate(); } @@ -266,8 +266,8 @@ load_extop_module ( ) { SLAP_EXTOP_MAIN_FN *ext_main; - int (*ext_getoid)(int index, char *oid, int blen); - char *oid; + SLAP_EXTOP_GETOID_FN *ext_getoid; + struct berval oid; int rc; ext_main = (SLAP_EXTOP_MAIN_FN *)module_resolve(module, "ext_main"); @@ -280,19 +280,15 @@ load_extop_module ( return(-1); } - oid = ch_malloc(256); - rc = (ext_getoid)(0, oid, 256); + rc = (ext_getoid)(0, &oid, 256); if (rc != 0) { - ch_free(oid); return(rc); } - if (*oid == 0) { - free(oid); + if (oid.bv_val == NULL || oid.bv_len == 0) { return(-1); } - rc = load_extop( oid, ext_main ); - free(oid); + rc = load_extop( &oid, ext_main ); return rc; } #endif /* SLAPD_EXTERNAL_EXTENSIONS */