Pergunta de entrevista da empresa MathWorks

what precaution should we take when using malloc.

Resposta da entrevista

Sigiloso

2 de abr. de 2013

Make sure to call free() when you use malloc() or calloc(). Don't reassign pointer which points to allocated memory location without free()ing it first i.e. don't lose the reference. Be careful when using realloc(). Do not use the same pointer for input & output parameters.