Permalink
Browse files

Fix memory leak in get_head_and_shoulders function

  • Loading branch information...
1 parent 7e028f2 commit 612fdb10ac4acccaf4802f992251520dfc186394 @joaquimrocha committed May 2, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 skeltrack/skeltrack-skeleton.c
View
10 skeltrack/skeltrack-skeleton.c
@@ -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);

0 comments on commit 612fdb1

Please sign in to comment.