mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-12-24 18:56:46 +07:00
Fix uninitialized warning
Initialize variable to NULL before calling kmod_module_new_from_lookup(). libkmod/libkmod-module.c: In function 'kmod_module_new_from_lookup.part.4.constprop': libkmod/libkmod-module.c:192:8: warning: 'depmod' may be used uninitialized in this function [-Wmaybe-uninitialized] list = kmod_list_prepend(list, depmod); ^ libkmod/libkmod-module.c:173:23: note: 'depmod' was declared here struct kmod_module *depmod;
This commit is contained in:
parent
a5f799af98
commit
01f9bc6dee
@ -170,7 +170,7 @@ int kmod_module_parse_depline(struct kmod_module *mod, char *line)
|
|||||||
p++;
|
p++;
|
||||||
for (p = strtok_r(p, " \t", &saveptr); p != NULL;
|
for (p = strtok_r(p, " \t", &saveptr); p != NULL;
|
||||||
p = strtok_r(NULL, " \t", &saveptr)) {
|
p = strtok_r(NULL, " \t", &saveptr)) {
|
||||||
struct kmod_module *depmod;
|
struct kmod_module *depmod = NULL;
|
||||||
const char *path;
|
const char *path;
|
||||||
|
|
||||||
path = path_join(p, dirnamelen, buf);
|
path = path_join(p, dirnamelen, buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user