commit | 67d94ad38853b58f658f84e69d33145dfbff3721 | [log] [tgz] |
---|---|---|
author | Cristian RodrÃguez <crrodriguez@opensuse.org> | Fri Dec 23 03:06:56 2011 -0200 |
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | Fri Dec 23 03:08:57 2011 -0200 |
tree | 391f0ba81aec00ab953f872b9e445f428ac275c1 | |
parent | bc85432aa33173eb1cd7c7a530d1565e4ee352c4 [diff] [blame] |
Fix leak on error path
diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c index 2f6e799..9a0dd2a 100644 --- a/libkmod/libkmod-index.c +++ b/libkmod/libkmod-index.c
@@ -342,8 +342,10 @@ errno = EINVAL; magic = read_long(file); - if (magic != INDEX_MAGIC) + if (magic != INDEX_MAGIC) { + fclose(file); return NULL; + } version = read_long(file); if (version >> 16 != INDEX_VERSION_MAJOR)