소스 검색

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;
 }