memory leaks and missing NULL checks.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
/* possibly a module outside /lib/modules/<ver>/ */
n = alloc_module(m.name, NULL, 0, m.depends, m.size);
}
+ if (!n) {
+ ULOG_ERR("Failed to allocate memory for module\n");
+ return -1;
+ }
+
n->usage = m.usage;
n->state = LOADED;
}
struct stat s;
int fd, ret = -1;
+ if (!path) {
+ ULOG_ERR("Path not specified\n");
+ return ret;
+ }
+
if (stat(path, &s)) {
ULOG_ERR("missing module %s\n", path);
return ret;
continue;
}
}
+
+ fclose(f);
}
int main(int argc, char **argv)