Explorar o código

src/core/perfmodel/perfmodel_history.c: only free when necessary

Nathalie Furmento %!s(int64=10) %!d(string=hai) anos
pai
achega
93d3ad04f1
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/core/perfmodel/perfmodel_history.c

+ 5 - 1
src/core/perfmodel/perfmodel_history.c

@@ -1071,7 +1071,11 @@ int starpu_perfmodel_load_file(const char *filename, struct starpu_perfmodel *mo
 
 int starpu_perfmodel_unload_model(struct starpu_perfmodel *model)
 {
-	free((char *)model->symbol);
+	if (model->symbol)
+	{
+		free((char *)model->symbol);
+		model->symbol = NULL;
+	}
 	_starpu_deinitialize_performance_model(model);
 	return 0;
 }