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:12:03 UTC

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

patacongo edited a comment on issue #1481:
URL: https://github.com/apache/incubator-nuttx/issues/1481#issuecomment-668718374


   Evern worse.  In all of these functions, memory is allocated for use in the OS using the user-space allocator malloc() or zalloc() interfaces:
   
       ./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);
       ./arch/arm/src/xmc4/xmc4_spi.c:  free(spics);
       ./crypto/blake2s.c:  free(in);
       ./drivers/lcd/pcf8574_lcd_backpack.c:  free(data);
       ./drivers/lcd/st7032.c:  free(data);
   
   In these cases, malloc(), zalloc(), and free() need to be replaced with kmm_malloc(), kmm_zalloc(), and kmm_free().
   
   In the other cases, the memory is already allocated with kmm_malloc() or kmm_zalloc(), but freed with free().  That is fixed 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