Skip to content

Commit

Permalink
coverity: #1425869
Browse files Browse the repository at this point in the history
do not unmap prematurely

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Dec 17, 2017
1 parent a93b81e commit 03f04e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lxc/lxc_user_nic.c
Expand Up @@ -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));
Expand Down

0 comments on commit 03f04e7

Please sign in to comment.