On Wed, 27 Oct 1999, Ilana Rudnik wrote:

> > int fskip(FILE *sf,long num_bytes,int dummy)
> > {
> > char *data = (char *) malloc(num_bytes);
> > return (num_bytes != fread(data,(size_t)1,(size_t)num_bytes,sf));
> > free(data);
> > }
> > =======
> I don't know if this is the literal code, or just a snip...
> If it is literal, you'll have to do this a little differently cause you are
> returning before you free the malloced space.  Memory leak!

...and using the allocated memory without bothering to check whether the
allocation was successful or not.

Well as this was only a quick fix this just might be acceptable but
checking it really isn't too much work.

Regards,
Kimmo Mustonen


--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to