selection_filter(): Don't leak Queue q1 and Map m2
authorIngo Weinhold <ingo_weinhold@gmx.de>
Thu, 18 Apr 2013 14:22:57 +0000 (16:22 +0200)
committerIngo Weinhold <ingo_weinhold@gmx.de>
Thu, 18 Apr 2013 16:12:07 +0000 (18:12 +0200)
src/selection.c

index 8ec633f..d179b57 100644 (file)
@@ -803,7 +803,11 @@ selection_filter(Pool *pool, Queue *sel1, Queue *sel2)
     {
       Id select = sel2->elements[i] & SOLVER_SELECTMASK;
       if (select == SOLVER_SOLVABLE_ALL)
-       return;
+       {
+         queue_free(&q1);
+         map_free(&m2);
+         return;
+       }
       if (select == SOLVER_SOLVABLE_REPO)
        {
          Solvable *s;
@@ -878,6 +882,8 @@ selection_filter(Pool *pool, Queue *sel1, Queue *sel2)
       j += 2;
     }
   queue_truncate(sel1, j);
+  queue_free(&q1);
+  map_free(&m2);
 }
 
 void