I am using this in a void:
unsigned char *nEncodedBytes = NULL;
nEncodedBytes = new unsigned char[m_lLenCompressedBytes];
short *shrtDecoded = NULL;
shrtDecoded = new short[iCountDecodedShorts];
short *m_ShortOut;
m_ShortOut = (short*)malloc(( 960*6)*sizeof(short));
unsigned char *m_DataBytes;
m_DataBytes = (unsigned char*)calloc((960*6),sizeof(char));
When I am done, I free the memory using
delete (nEncodedBytes);
delete (shrtDecoded);
free(m_DataBytes);
free(m_ShortOut);
Is this fine? I am unsure why I was using delete in one place, and free in the other. I copied my code around.
Is there a memory leak?
Thank you.