Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7fff2be

Browse files
committed
Simple pfree() mistake
1 parentb496441 commit7fff2be

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎machine_learning.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,14 @@ OkNNr_predict(int matrix_rows, int matrix_cols,
116116
if (idx[i]!=-1)
117117
result+=targets[idx[i]]*w[i] /w_sum;
118118

119+
pfree(w);
120+
pfree(distances);
121+
119122
/* this should never happen */
120123
if (idx[0]==-1)
121124
return-1;
122125

123-
pfree(distances);
124126
pfree(idx);
125-
pfree(w);
126127

127128
if (result<0)
128129
result=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp