Memory leak

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Memory leak

Matt Adcock
Valgrind reports this leak in pymudsys.c in function mudsys_add_cmd:

if(get_help(name,FALSE)==NULL && ((PyFunctionObject*)func)->func_doc!=NULL){
>>> BUFFER *buf = newBuffer(1);
      bufferCat(buf,
PyString_AsString(((PyFunctionObject*)func)->func_doc));
      bufferFormat(buf, SCREEN_WIDTH, 0);
      if(bufferLength(buf) > 0)
            add_help(name, bufferString(buf), group, NULL, FALSE);
}

The buffer doesn't look like it's getting freed.

-Matt
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak

Geoff Hollis
Thanks, fixed.

On Jul 3, 2008, at 6:00 PM, Matt Adcock wrote:

> Valgrind reports this leak in pymudsys.c in function mudsys_add_cmd:
>
> if(get_help(name,FALSE)==NULL && ((PyFunctionObject*)func)-
> >func_doc!=NULL){
> >>> BUFFER *buf = newBuffer(1);
>       bufferCat(buf, PyString_AsString(((PyFunctionObject*)func)-
> >func_doc));
>       bufferFormat(buf, SCREEN_WIDTH, 0);
>       if(bufferLength(buf) > 0)
>             add_help(name, bufferString(buf), group, NULL, FALSE);
> }
>
> The buffer doesn't look like it's getting freed.
>
> -Matt
>
>