Skip to content

Commit 9bd89e3

Browse files
committed
Simple pfree() mistake
1 parent 3586c94 commit 9bd89e3

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy