You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/08/04 17:04:46 UTC

[GitHub] [incubator-nuttx] patacongo commented on issue #1481: Illegal Usage of free() in the OS

patacongo commented on issue #1481:
URL: https://github.com/apache/incubator-nuttx/issues/1481#issuecomment-668715277


   Even worse.  In these cases, malloc() is used to allocate memory.  Calls to malloc are also not legal within the OS code:
   ./arch/arm/src/cxd56xx/cxd56_gnss.c:      free(buf);
   ./arch/arm/src/cxd56xx/cxd56_gnss.c:  free(buf);
       ./arch/arm/src/cxd56xx/cxd56_gnss.c:  free(buf);
       ./arch/arm/src/cxd56xx/cxd56_gnss.c:      free(buf);
       ./arch/arm/src/cxd56xx/cxd56_gnss.c:  free(buf);
       ./arch/arm/src/cxd56xx/cxd56_gnss.c:          free(priv->cepbuf);
       ./crypto/blake2s.c:  free(in);
       ./drivers/lcd/pcf8574_lcd_backpack.c:
       ./drivers/lcd/st7032.c:  free(data);
   
   Another related and forbidden function, zalloc() is used here:
   
       ./arch/arm/src/xmc4/xmc4_spi.c:  free(spics);
   
   The remaining were allocated using kmm_malloc() or kmm_zalloc(), but freed with free().  These are address in PR #1507


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org