From ae65a0f7f29935b957f0480da1e2263335fb72eb Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 9 Dec 2017 19:18:09 +0100 Subject: [PATCH] coverity: #1425869 do not unmap prematurely Signed-off-by: Christian Brauner --- src/lxc/lxc_user_nic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc_user_nic.c b/src/lxc/lxc_user_nic.c index 6f550f0da..5752935d0 100644 --- a/src/lxc/lxc_user_nic.c +++ b/src/lxc/lxc_user_nic.c @@ -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)); -- 2.47.3