summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@hardinfo.org>2014-04-28 21:02:45 -0300
committerLucas De Marchi <lucas.demarchi@intel.com>2014-05-14 20:21:20 -0300
commitc1bc88c98ed2c1dce4de8a6ed45db212a19f79f4 (patch)
treeb1df8bf4f37b02b30713517082df87e43aac3bce
parente84d912bd70bc6d906fd405bde486c332537effe (diff)
downloadkmod-c1bc88c98ed2c1dce4de8a6ed45db212a19f79f4.tar.gz
kmod-c1bc88c98ed2c1dce4de8a6ed45db212a19f79f4.tar.bz2
kmod-c1bc88c98ed2c1dce4de8a6ed45db212a19f79f4.zip
Free abspath if kmod_module_new_from_path() fails.
-rw-r--r--libkmod/libkmod-module.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index 1d90f34..a160d5b 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -420,8 +420,10 @@ KMOD_EXPORT int kmod_module_new_from_path(struct kmod_ctx *ctx,
}
err = kmod_module_new(ctx, name, name, namelen, NULL, 0, &m);
- if (err < 0)
+ if (err < 0) {
+ free(abspath);
return err;
+ }
m->path = abspath;
*mod = m;