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