mirror of
https://github.com/apache/nuttx.git
synced 2026-10-03 04:07:55 +00:00
drivers/rptun: should free the image buffer if open failed
Memleak Bug fix, when file_read() failed in rptun_store_open(), memleak occur. Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
parent
c724618705
commit
ffb18cd25a
1 changed files with 1 additions and 0 deletions
|
|
@ -825,6 +825,7 @@ static int rptun_store_open(FAR void *store_,
|
|||
ret = file_read(&store->file, store->buf, len);
|
||||
if (ret < 0)
|
||||
{
|
||||
kmm_free(store->buf);
|
||||
file_close(&store->file);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue