Skip to content

Commit 59454c3

Browse files
author
zhouwg
committed
ggml-hexagon: fix potential resource leak in class hexagon_profiler
1 parent c85c433 commit 59454c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ggml/src/ggml-hexagon/ggml-hexagon.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ class hexagon_profiler {
909909
written_size = fwrite(prefix, 1, strlen(prefix), _fp_profile_file);
910910
if (written_size != strlen(prefix)) {
911911
GGMLHEXAGON_LOG_WARN("write data to file %s failed, reason: %s", profiler_filename, strerror(errno));
912-
reset();
912+
profiler_deinit();
913913
return;
914914
}
915915

@@ -918,7 +918,7 @@ class hexagon_profiler {
918918
written_size = fwrite(profiler_info, 1, strlen(profiler_info), _fp_profile_file);
919919
if (written_size != strlen(profiler_info)) {
920920
GGMLHEXAGON_LOG_WARN("write data to file %s failed, reason: %s", profiler_filename, strerror(errno));
921-
reset();
921+
profiler_deinit();
922922
return;
923923
}
924924
fprintf(_fp_profile_file, "\n\n");

0 commit comments

Comments
 (0)