hi,
The basic rule of thumb is 'whoever allocated the memory, should free it too' . Its a helpful guideline which helps avoid trouble. Simply put, if memory was already allocated outside the dll and its handle is passed as input to the dll, then whichever entity did this memroy allocation,initially, should free it . And if the memory allocation was done ,say by a function inside the dll, then it is better to free it from within the dll itself. Anyways more googling should be helpful here.
Please take a look at this question[
^]