coverity: #1435203

Resource leak Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent dbdf8cf4
......@@ -83,8 +83,10 @@ int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback,
return -1;
}
if (st.st_size == 0)
if (st.st_size == 0) {
close(fd);
return 0;
}
buf = lxc_strmmap(NULL, st.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if (buf == MAP_FAILED) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment