Commit bd9b052b authored by Libo Chen's avatar Libo Chen Committed by Pavel Emelyanov

image: potential fd leak in err case

without this patch, fd will not be freeed

* Changelog from v1:
	* just free fd, no crt.ids
Signed-off-by: 's avatarLibo Chen <libo.chen@huawei.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 112d7d77
......@@ -74,8 +74,10 @@ int write_img_inventory(void)
crt.state = TASK_ALIVE;
crt.pid.real = getpid();
if (get_task_ids(&crt))
if (get_task_ids(&crt)){
close(fd);
return -1;
}
he.root_ids = crt.ids;
......
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