ctx: Require dll parameter otherwise we are leaking it
This commit is contained in:
parent
a85a4a8b48
commit
674e5e8b3d
|
@ -452,6 +452,10 @@ static void *load_dynamic_driver(sc_context_t *ctx, void **dll, const char *name
|
|||
const char *(*modversion)(void) = NULL;
|
||||
const char *(**tmodv)(void) = &modversion;
|
||||
|
||||
if (dll == NULL) {
|
||||
sc_log(ctx, "No dll parameter specified");
|
||||
return NULL;
|
||||
}
|
||||
if (name == NULL) { /* should not occur, but... */
|
||||
sc_log(ctx, "No module specified");
|
||||
return NULL;
|
||||
|
@ -481,7 +485,7 @@ static void *load_dynamic_driver(sc_context_t *ctx, void **dll, const char *name
|
|||
sc_dlclose(handle);
|
||||
return NULL;
|
||||
}
|
||||
if (dll)
|
||||
|
||||
*dll = handle;
|
||||
sc_log(ctx, "successfully loaded card driver '%s'", name);
|
||||
return modinit(name);
|
||||
|
|
Loading…
Reference in New Issue