mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +08: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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user