mindtct: Fix a memory leak in morph_TF_map()

cimage is leaked when mimage fails to allocate.

Spotted by Seth Arnold

Closes: #82
This commit is contained in:
Bastien Nocera 2018-09-28 17:16:03 +02:00
parent 5e8b4a81e9
commit c35ad20249

View file

@ -675,6 +675,7 @@ int morph_TF_map(int *tfmap, const int mw, const int mh,
mimage = (unsigned char *)malloc(mw*mh);
if(mimage == (unsigned char *)NULL){
free(cimage);
fprintf(stderr, "ERROR : morph_TF_map : malloc : mimage\n");
return(-661);
}