On Mon, Nov 5, 2018 at 5:42 AM Peter Maydell <[email protected]> wrote: > > Hi; Coverity has noticed a memory leak in hw/riscv/spike.c: > it malloc()s memory into config_string(), but never frees it. > (CID 1391015). This isn't a very serious leak since the function > only ever runs once, but it would be nice to fix this for 3.1 > (it is the only coverity error in the riscv code, and one of > just 8 unaddressed for QEMU as a whole). > > Incidentally, "malloc and then snprintf" would be better > done using g_strdup_printf(), which automatically allocates > sufficient memory for the string, avoiding the need to > try to pre-calculate the right size.
I can check this out today. Thanks for pointing it out. Alistair > > thanks > -- PMM >
