Commit 317644c1 authored by Yulong Zhang's avatar Yulong Zhang Committed by sanglipeng
Browse files

tools/iio/iio_utils:fix memory leak

stable inclusion
from stable-v5.10.173
commit 8db64cea4788d972dcc9e064ad93c935ed67e4a8
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7X0QU

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8db64cea4788d972dcc9e064ad93c935ed67e4a8



--------------------------------

[ Upstream commit f2edf0c8 ]

1. fopen sysfs without fclose.
2. asprintf filename without free.
3. if asprintf return error,do not need to free the buffer.

Signed-off-by: default avatarYulong Zhang <yulong.zhang@metoak.net>
Link: https://lore.kernel.org/r/20230117025147.69890-1-yulong.zhang@metoak.net


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 91eb70cc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment