mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
nbis: Use GLib memory management functions
Apply the previously added spatch/coccinell file to replace all free/malloc/realloc calls with g_free/g_malloc/g_realloc. It also removes all the error code paths that we do not need to check anymore. This means that the returned data must be free'ed using g_free rather than free, making memory management more consistent.
This commit is contained in:
committed by
Marco Trevisan (Treviño)
parent
56543e1311
commit
30a449841c
@@ -100,12 +100,7 @@ int chain_code_loop(int **ochain, int *onchain,
|
||||
/* number of points in the contour. There will be one chain code */
|
||||
/* between each point on the contour including a code between the */
|
||||
/* last to the first point on the contour (completing the loop). */
|
||||
chain = (int *)malloc(ncontour * sizeof(int));
|
||||
/* If the allocation fails ... */
|
||||
if(chain == (int *)NULL){
|
||||
fprintf(stderr, "ERROR : chain_code_loop : malloc : chain\n");
|
||||
return(-170);
|
||||
}
|
||||
chain = (int *)g_malloc(ncontour * sizeof(int));
|
||||
|
||||
/* For each neighboring point in the list (with "i" pointing to the */
|
||||
/* previous neighbor and "j" pointing to the next neighbor... */
|
||||
|
||||
Reference in New Issue
Block a user