Skip to content

Commit a2f4659

Browse files
committed
Corrected a buggy lack of allocation.
1 parent 61f587a commit a2f4659

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/denoise.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ int rnnoise_init(DenoiseState *st, RNNModel *model) {
295295
st->rnn.model = model;
296296
else
297297
st->rnn.model = &rnnoise_model_orig;
298+
st->rnn.vad_gru_state = calloc(sizeof(float), st->rnn.model->vad_gru_size);
299+
st->rnn.noise_gru_state = calloc(sizeof(float), st->rnn.model->noise_gru_size);
300+
st->rnn.denoise_gru_state = calloc(sizeof(float), st->rnn.model->denoise_gru_size);
298301
return 0;
299302
}
300303

@@ -306,6 +309,9 @@ DenoiseState *rnnoise_create(RNNModel *model) {
306309
}
307310

308311
void rnnoise_destroy(DenoiseState *st) {
312+
free(st->rnn.vad_gru_state);
313+
free(st->rnn.noise_gru_state);
314+
free(st->rnn.denoise_gru_state);
309315
free(st);
310316
}
311317

0 commit comments

Comments
 (0)