瀏覽代碼

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

Nathalie Furmento 10 年之前
父節點
當前提交
93d3ad04f1
共有 1 個文件被更改,包括 5 次插入1 次删除
  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;
 }