I think this doesn't have any effect because malloc is provided by pios_msheap.c (at least on f3 and f4 targets).
It this should be fixed, there are a couple more files which should be fixed as well:
* flight/PiOS/STM32F10x/pios_tim.c:      tim_dev = (struct pios_tim_dev *)malloc(sizeof(*tim_dev));
* flight/PiOS/STM32F30x/pios_i2c.c:      i2c_adapter = (struct pios_i2c_adapter *)malloc(sizeof(*i2c_adapter));
* flight/PiOS/STM32F30x/pios_spi.c:      return (malloc(sizeof(struct pios_spi_dev)));
* flight/PiOS/STM32F30x/pios_tim.c:      tim_dev = (struct pios_tim_dev *)malloc(sizeof(*tim_dev));
* flight/PiOS/STM32F4xx/pios_i2c.c:      i2c_adapter = (struct pios_i2c_adapter *)malloc(sizeof(*i2c_adapter));
* flight/PiOS/STM32F4xx/pios_tim.c:      tim_dev = (struct pios_tim_dev *)malloc(sizeof(*tim_dev));
* flight/PiOS.osx/osx/pios_com.c://      com_dev = (struct pios_com_dev *)malloc(sizeof(*com_dev));
* flight/PiOS.osx/osx/pios_rcvr.c:  rcvr_dev = (struct pios_rcvr_dev *)malloc(sizeof(*rcvr_dev));
* flight/PiOS.posix/posix/pios_com.c://  com_dev = (struct pios_com_dev *)malloc(sizeof(*com_dev));
* flight/PiOS.posix/posix/pios_rcvr.c:  rcvr_dev = (struct pios_rcvr_dev *)malloc(sizeof(*rcvr_dev));
* flight/tests/logfs/pios_flash_ut.c:    struct flash_ut_dev * flash_dev = malloc(sizeof(struct flash_ut_dev));
* flight/tests/logfs/pios_flash_ut.c:    unsigned char * buf = malloc(flash_dev->cfg->size_of_sector);