[Rd] Memory leak possible when redirecting R console

From: Jeffrey Horner <jeff.horner_at_vanderbilt.edu>
Date: Sun, 02 Sep 2007 17:16:43 -0500


To trigger the memory leak, an application embedding R will have printed   a vector element of size R_BUFSIZE or more to stdout, so long as the R_Outputfile pointer is NULL and R was compiled with vasprintf support. The leak is in Rcons_vprintf from printutils.c. It looks as though someone set up a fix for this but forgot a critical flag assignment when vasprintf() is called (vasprintf mallocs a buffer to print to, so it needs to be freed after use). Here's the fix:

Index: printutils.c




R-devel_at_r-project.org mailing list
Received on Sun 02 Sep 2007 - 22:22:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 02 Sep 2007 - 22:40:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.