Explorar o código

Merge pull request #2254 from misonyo/dev

[driver/ringbuffer]illegal access to freed memory
Bernard Xiong %!s(int64=6) %!d(string=hai) anos
pai
achega
358a3884f6
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      components/drivers/src/ringbuffer.c

+ 1 - 0
components/drivers/src/ringbuffer.c

@@ -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);