Merge pull request #2254 from misonyo/dev

[driver/ringbuffer]illegal access to freed memory
This commit is contained in:
Bernard Xiong 2019-01-23 11:11:03 +08:00 committed by GitHub
commit 358a3884f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -340,6 +340,7 @@ struct rt_ringbuffer* rt_ringbuffer_create(rt_uint16_t size)
if (pool == RT_NULL)
{
rt_free(rb);
rb = RT_NULL;
goto exit;
}
rt_ringbuffer_init(rb, pool, size);