Ver código fonte

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

Nathalie Furmento 10 anos atrás
pai
commit
93d3ad04f1
1 arquivos alterados com 5 adições e 1 exclusões
  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;
 }