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:
parent
5e8b4a81e9
commit
c35ad20249
1 changed files with 1 additions and 0 deletions
|
@ -675,6 +675,7 @@ int morph_TF_map(int *tfmap, const int mw, const int mh,
|
||||||
|
|
||||||
mimage = (unsigned char *)malloc(mw*mh);
|
mimage = (unsigned char *)malloc(mw*mh);
|
||||||
if(mimage == (unsigned char *)NULL){
|
if(mimage == (unsigned char *)NULL){
|
||||||
|
free(cimage);
|
||||||
fprintf(stderr, "ERROR : morph_TF_map : malloc : mimage\n");
|
fprintf(stderr, "ERROR : morph_TF_map : malloc : mimage\n");
|
||||||
return(-661);
|
return(-661);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue