treewide: rename exec_timeout to rpc_exec_timeout
[project/rpcd.git] / plugin.c
index b75241aae1f82ce0a84b5d40c1c74b2e8c0577ed..532fa15284b17a715d896244043befc2c93e1063 100644 (file)
--- a/plugin.c
+++ b/plugin.c
@@ -324,7 +324,9 @@ rpc_plugin_parse_exec(const char *name, int fd)
        if (!obj_type)
                return NULL;
 
-       asprintf((char **)&obj_type->name, "luci-rpc-plugin-%s", name);
+       if (asprintf((char **)&obj_type->name, "luci-rpc-plugin-%s", name) < 0)
+               return NULL;
+
        obj_type->methods = methods;
        obj_type->n_methods = n_method;
 
@@ -410,7 +412,7 @@ rpc_plugin_register_library(struct ubus_context *ctx, const char *path)
        struct rpc_plugin *p;
        void *dlh;
 
-       dlh = dlopen(path, RTLD_LAZY | RTLD_GLOBAL);
+       dlh = dlopen(path, RTLD_LAZY | RTLD_LOCAL);
 
        if (!dlh)
                return UBUS_STATUS_UNKNOWN_ERROR;