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:
Bastien Nocera 2018-12-12 17:14:21 +01:00
parent 74bb899ce2
commit eaa4aa964c

View file

@ -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);
}