do not unmap prematurely

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2017-12-09 19:18:09 +01:00
parent de429548c4
commit 3ca108148b
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -625,8 +625,8 @@ static bool cull_entries(int fd, char *name, char *net_type, char *net_link,
}
free(entry_lines);
lxc_strmunmap(buf, sb.st_size);
ret = ftruncate(fd, buf_start - buf);
lxc_strmunmap(buf, sb.st_size);
if (ret < 0)
usernic_error("Failed to set new file size: %s\n",
strerror(errno));