# Memory Leak?

Ian Macintosh (ian@iman.internet.co.nz)
Mon, 15 May 1995 23:54:51 PDT

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

    A fix to that previous message of mine.

    On Mon, 15 May 1995, Ian Macintosh wrote:

    > in tasks.c, the function do_command_task(), the last 'else' section, and
    > I quote the pertinant code:
    >
    >         else {
    >             Var result, args;
    > ...[snip]
    >             args = parse_into_wordlist(command);
    > ...[snip]
    >             free_var(result);
                  ^^^^^^^^^^^^^^^^^
    > 	}
    >
    > *should* have the last section read:
    >
    >             free_var(result);
    > 	      free_var(args);
                  ^^^^^^^^^^^^^^^
    > 	}

    What I wrote above is incorrect.  It should be:

            else {
                Var result, args;
    ...[snip]
                args = parse_into_wordlist(command);
    ...[snip]
    	}

    *should* have the last section read:

    ...[snip]
                free_var(result);
    	}

    'Var args' is released by the call to do_command_task() (or, at least,
    that's what I can make out).  My appologies for the incorrect first post,
    I got confused with my earlier fiddling.  If you have the free_var(args)
    call with the free_var(result), you will panic your server, a unhappy
    state of affairs indeed :)

    Anyway, wade through that code if you feel like a bit of punishment, and
    let me know if it's a valid assumption.

    Regards,

    Ian.

    +--------------------------------------------------------------------+
    | Ian Macintosh         | P.O. Box 24-036 | Anything really worth    |
    | General Manager       | Royal Oak       | doing, is worth doing    |
    | Sytek New Zealand Ltd | Auckland 1      | badly.     - Duncan Shaw |
    +--------------------------------------------------------------------+