]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/module.c: replace asserts
authorTomas Krizek <tomas.krizek@nic.cz>
Wed, 24 Mar 2021 16:44:46 +0000 (17:44 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 25 May 2021 12:39:42 +0000 (14:39 +0200)
lib/module.c

index 2174f90eaedc4405451dfa7282c9a9f957a1cee5..577ed9591dba2b61ab38291d58644aa6221ad3f2 100644 (file)
@@ -36,7 +36,8 @@ static void *load_symbol(void *lib, const char *prefix, const char *name)
 
 static int load_library(struct kr_module *module, const char *name, const char *path)
 {
-       assert(module && name && path);
+       if (!kr_assume(module && name && path))
+               return kr_error(EINVAL);
        /* Absolute or relative path (then only library search path is used). */
        auto_free char *lib_path = kr_strcatdup(4, path, "/", name, LIBEXT);
        if (lib_path == NULL) {