Fix format-security warnings when building with trace-sync
[lttv.git] / lttv / lttv / sync / event_analysis_chull.c
index 154258e00effc5af9369dc13c1c036e2d999125a..cc3aad52b4a3e8b2eabb98569f7e582154dd4270 100644 (file)
@@ -240,7 +240,7 @@ static void openGraphFiles(SyncState* const syncState)
                                if ((analysisData->graphsData->hullPoints[i][j]= fopen(name, "w")) ==
                                        NULL)
                                {
-                                       g_error(strerror(errno));
+                                       g_error("%s", strerror(errno));
                                }
                        }
                }
@@ -249,7 +249,7 @@ static void openGraphFiles(SyncState* const syncState)
        retval= chdir(cwd);
        if (retval == -1)
        {
-               g_error(strerror(errno));
+               g_error("%s", strerror(errno));
        }
        free(cwd);
 }
@@ -329,7 +329,7 @@ static void closeGraphFiles(SyncState* const syncState)
                                retval= fclose(analysisData->graphsData->hullPoints[i][j]);
                                if (retval != 0)
                                {
-                                       g_error(strerror(errno));
+                                       g_error("%s", strerror(errno));
                                }
                        }
                }
@@ -384,13 +384,15 @@ static void destroyAnalysisCHull(SyncState* const syncState)
 
                        for (j= 0; j < i; j++)
                        {
-                               // There seems to be a memory leak in glpk, valgrind reports a
-                               // loss (reachable) even if the problem is deleted
                                glp_delete_prob(analysisData->lps[i][j]);
                        }
                        free(analysisData->lps[i]);
                }
                free(analysisData->lps);
+
+               /* Be careful, this invalidates all problem objects which still exist.
+                * Don't keep copies of lps past this point. */
+               glp_free_env();
        }
 #endif
 
@@ -1675,14 +1677,14 @@ static AllFactors* finalizeAnalysisCHullLP(SyncState* const syncState)
 
                                if ((fp= fopen(fileName, "w")) == NULL)
                                {
-                                       g_error(strerror(errno));
+                                       g_error("%s", strerror(errno));
                                }
                                fprintf(fp, "#%-24s %-25s %-25s %-25s\n", "x", "middle", "min", "max");
 
                                retval= chdir(cwd);
                                if (retval == -1)
                                {
-                                       g_error(strerror(errno));
+                                       g_error("%s", strerror(errno));
                                }
                                free(cwd);
 
This page took 0.023441 seconds and 4 git commands to generate.