Hi,

I have a quick question: I using dynamic string inside function and the value returned by the function is the string. the problem is, after running some tests, i have a heap problem, memory leak.

As far as i know any data used by function is deleted upon exit so there is no need to use "delete [] uncompr ;".

Here is the func. code: (ps: all g_* are globals)
Code:
Byte* UnCompress (Byte* compr){

	int err;
	Byte *uncompr  =  new Byte [g_uncomprLen];

	err = uncompress(uncompr, &g_uncomprLen, compr, g_comprLen);
    if (err!=Z_OK)
	{
		 printf("Uncompress() failed : %d\n", err);
		 return 0;
	} else {
		return uncompr;
	}
}
I am trying to eliminate options so tell me what you think, can it be my problem?