mindtct: Fix memory leaks in get_centered_contour()
The first contour wasn't freed if we failed on the second contour. libfprint/nbis/mindtct/contour.c:521:14: warning: Potential leak of memory pointed to by 'half1_ex' return(ret); ^~~ libfprint/nbis/mindtct/contour.c:521:14: warning: Potential leak of memory pointed to by 'half1_ey' return(ret); ^~~ libfprint/nbis/mindtct/contour.c:521:14: warning: Potential leak of memory pointed to by 'half1_x' return(ret); ^~~ libfprint/nbis/mindtct/contour.c:521:14: warning: Potential leak of memory pointed to by 'half1_y' return(ret); ^~~
This commit is contained in:
parent
74bb899ce2
commit
eaa4aa964c
1 changed files with 2 additions and 0 deletions
|
@ -517,6 +517,8 @@ int get_centered_contour(int **ocontour_x, int **ocontour_y,
|
|||
|
||||
/* If system error occurred on 2nd trace ... */
|
||||
if(ret < 0){
|
||||
/* Deallocate loop's contour. */
|
||||
free_contour(half1_x, half1_y, half1_ex, half1_ey);
|
||||
/* Return error code. */
|
||||
return(ret);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue