2020.07.16 21:04 "[Tiff] program crashing when using TIFFClientOpen API during closing the file.", by Upanita Goswami
- 2020.07.16 22:15 "Re: [Tiff] program crashing when using TIFFClientOpen API during closing the file.", by Bob Friesenhahn
2020.07.17 14:24 "Re: [Tiff] Fw: program crashing when using TIFFClientOpen API during closing the file.", by Upanita Goswami
Thanks Bob for the explanation.
If I have struct; say 'foo',
struct foo
{
int* ptr1; //to be allocated by author of the struct using malloc
int* ptr2; //to be allocated by author of the struct using malloc
void*ptr3; // to be allocated by user of struct .i.e. client using say malloc (not new operator)
}
- Allocate foo: foo* f = (foo*)malloc(sizeof(foo));
- Free foo: free(f);-> Will this not free memory pointed by ptr3 which is allocated and owned by user ?
This is the situation inside TIFFClose(p)-> TIFFCleanup(p) -> TIFFFree(p)->free(p) where p is the TIFF* like foo* in the dummy example and thandle_t is like ptr3 above allocated by our code.
Thanks,
Upanita