summaryrefslogtreecommitdiff
path: root/kmodloader.c
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2016-12-17 17:12:28 -0800
committerJohn Crispin <john@phrozen.org>2016-12-19 08:53:10 +0100
commitdb070f15ac559e3bd406cb8b8cccf40f78e75094 (patch)
treeef8247c449c24e0309337b15cb82ce87509e00b5 /kmodloader.c
parentacc48b553adfbdba77a5fa19e11bf7d69c65d596 (diff)
downloadubox-db070f15ac559e3bd406cb8b8cccf40f78e75094.tar.gz
ubox: Fix some memory leaks
Avoids leaking memory when exiting early. Signed-off by: Rosen <rosenp@gmail.com>
Diffstat (limited to 'kmodloader.c')
-rw-r--r--kmodloader.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kmodloader.c b/kmodloader.c
index 40edbf0..f80835a 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -775,11 +775,15 @@ static int main_loader(int argc, char **argv)
strcpy(path, dir);
strcat(path, "*");
- if (scan_loaded_modules())
+ if (scan_loaded_modules()) {
+ free (path);
return -1;
+ }
- if (scan_module_folders())
+ if (scan_module_folders()) {
+ free (path);
return -1;
+ }
syslog(LOG_INFO, "kmodloader: loading kernel modules from %s\n", path);