commit | 4088b27e2138271fc84df3e02faf6e23a7c89458 | [log] [tgz] |
---|---|---|
author | Cristian RodrÃguez <crrodriguez@opensuse.org> | Mon Dec 26 01:38:04 2011 -0300 |
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | Mon Dec 26 09:55:15 2011 -0200 |
tree | c444870e3c0d972751a03d4d35482200ff8ce08f | |
parent | ef4a349aaa4fb6f8111144a9b1c96d652bdb3581 [diff] |
index_file_open: fix another fd leak on error path.
diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c index 9a0dd2a..580b059 100644 --- a/libkmod/libkmod-index.c +++ b/libkmod/libkmod-index.c
@@ -348,8 +348,10 @@ } version = read_long(file); - if (version >> 16 != INDEX_VERSION_MAJOR) + if (version >> 16 != INDEX_VERSION_MAJOR) { + fclose(file); return NULL; + } new = NOFAIL(malloc(sizeof(struct index_file))); new->file = file;