[Theora-dev] Small memory leak...

Mat
Wed, 26 Oct 2005 00:26:06 -0000

Hi all.
In  lib\encoder_toplevel.c , row 1123-1128:

#ifndef LIBOGG2
  /* So we're expecting the application with free this? */
  op->packet=malloc(oggpack_bytes(opb));
  memcpy(op->packet, oggpack_get_buffer(opb), oggpack_bytes(opb));
  oggpack_writeclear(opb);
#else

In my small testing application my debugger says there are 50 bytes of
memory lost and it refers to
    op->packet=malloc(oggpack_bytes(opb));
I tried also:
    op->packet=_ogg_malloc(oggpack_bytes(opb));
But I got always this leak.
How should I free that space ?
    _ogg_free(op->packet);
In the end of my application doesn't work... segmentation fault.
I can't go on if I don't solve this so help me please...

In alternative I could avoid this function if possible... but I don't
know how.
Thank in advance.
-Mat-