Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
Fix memory leak in get_head_and_shoulders function
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquimrocha committed May 2, 2012
1 parent 7e028f2 commit 612fdb1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions skeltrack/skeltrack-skeleton.c
Original file line number Diff line number Diff line change
Expand Up @@ -1251,13 +1251,19 @@ get_head_and_shoulders (GList *nodes,

right_shoulder_closest_point = get_closest_node (nodes, shoulder_point);
if (right_shoulder_closest_point->i > centroid->i)
continue;
{
g_slice_free (Node, shoulder_point);
continue;
}

shoulder_point->x = node->x + shoulders_offset / 2;

left_shoulder_closest_point = get_closest_node (nodes, shoulder_point);
if (left_shoulder_closest_point->i < centroid->i)
continue;
{
g_slice_free (Node, shoulder_point);
continue;
}

right_shoulder_dist = get_distance (node, right_shoulder_closest_point);
left_shoulder_dist = get_distance (node, left_shoulder_closest_point);
Expand Down

0 comments on commit 612fdb1

Please sign in to comment.