nuttx-apps/benchmarks/ramspeed
chenrun1 875f2fcc1e ramspeed:Fix memleak due to double malloc.
if (allocate_rw_address)
    {
      info->dest = malloc(info->size);
      info->src = malloc(info->size);
    }
  if ((info->dest == NULL && !info->allocate_rw_address) || info->size == 0)
    {
      printf(RAMSPEED_PREFIX "Missing required arguments\n");
      goto out;
    }
  else
    {
      /* We need to automatically apply for memory */
      printf(RAMSPEED_PREFIX "Allocate RW buffers on heap\n");
      info->dest = malloc(info->size);
      if (info->dest == NULL)
        {
          printf(RAMSPEED_PREFIX "Dest Alloc Memory Failed!\n");
          goto out;
        }
      info->src = malloc(info->size);
      if (info->src == NULL)
        {
          printf(RAMSPEED_PREFIX "Src Alloc Memory Failed!\n");
          goto out;
        }
    }

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-08 09:51:55 +08:00
..
Kconfig ramspeed:Add log printing & improve test accuracy & optional test cases 2024-08-08 09:51:55 +08:00
Make.defs
Makefile
ramspeed_main.c ramspeed:Fix memleak due to double malloc. 2024-08-08 09:51:55 +08:00