Fix leaks and invalid memory accesses
[lttv.git] / lttv / lttv / sync / event_analysis_chull.c
index b89f89ca01c643a267f88d2f2f2e0ccc86e92419..0e583791cedd7d8a3a67ec4c5099afd48213adcf 100644 (file)
@@ -26,6 +26,7 @@
 #include <float.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "sync_chain.h"
@@ -341,6 +342,7 @@ static void destroyAnalysisCHull(SyncState* const syncState)
                for (j= 0; j < syncState->traceNb; j++)
                {
                        g_queue_foreach(analysisData->hullArray[i][j], gfPointDestroy, NULL);
+                       g_queue_free(analysisData->hullArray[i][j]);
                }
                free(analysisData->hullArray[i]);
        }
@@ -926,7 +928,7 @@ void calculateFactorsMiddle(FactorsCHull* const factors)
        bmin= factors->min->drift;
        bmax= factors->max->drift;
 
-       g_assert_cmpfloat(bmax, >, bmin);
+       g_assert_cmpfloat(bmax, >=, bmin);
 
        factors->approx= malloc(sizeof(Factors));
        bhat= (bmax * bmin - 1. + sqrt(1. + pow(bmax, 2.) * pow(bmin, 2.) +
This page took 0.022993 seconds and 4 git commands to generate.