Commit eaa4aa96 authored by Bastien Nocera's avatar Bastien Nocera

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);
             ^~~
parent 74bb899c
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment