# Memory leak in free_program()

Brian Buchanan (brian@wasteland.calbbs.com)
Fri, 12 Jul 1996 17:17:50 PDT

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    There is a memory leak in free_program() in program.c.  It involves FLOAT
    literals not being freed because the code assumes that a literal will only
    need to be freed if it's TYPE_STR.  The lines in question are:

                if (p->literals[i].type == TYPE_STR) /* will not be a LIST */
                    free_str(p->literals[i].v.str);

    The easiest(and best?) fix is to just replace those lines with:

    free_var(p->literals[i]);

    ---
       Brian Buchanan    sysop@calbbs.com    brian@wasteland.calbbs.com
          -= ArchWizard of Farpoint (wasteland.calbbs.com 8888) =-