pea
developer
Hi all,
I am re-writing the GIF routines because the malloc/free flow is much less than optimal (i.e. its pretty damn random, malloc in one function, free in a completely different one).
Just wanted to confirm. If I have a struct like this:
And then I allocate memory for the struct like this:
Then freeing 'gif' without first freeing 'gif->imag' is going to result in a leak, right?
Cheers,
Pea
I am re-writing the GIF routines because the malloc/free flow is much less than optimal (i.e. its pretty damn random, malloc in one function, free in a completely different one).
Just wanted to confirm. If I have a struct like this:
Code:
typedef struct tGPD_gif{
int width;
int height;
short *imag;
}tGPD_gif;
Code:
tGPD_gif *gif;
gif = malloc( some_size );
gif->imag = malloc( some_other_size);
Then freeing 'gif' without first freeing 'gif->imag' is going to result in a leak, right?
Cheers,
Pea