mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
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:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user