Skip to content

Commit dead333

Browse files
committed
Corrected a buggy lack of allocation.
1 parent 78abb35 commit dead333

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
@@ -294,6 +294,9 @@ int rnnoise_init(DenoiseState *st, RNNModel *model) {
294294
st->rnn.model = model;
295295
else
296296
st->rnn.model = &model_orig;
297+
st->rnn.vad_gru_state = calloc(sizeof(float), st->rnn.model->vad_gru_size);
298+
st->rnn.noise_gru_state = calloc(sizeof(float), st->rnn.model->noise_gru_size);
299+
st->rnn.denoise_gru_state = calloc(sizeof(float), st->rnn.model->denoise_gru_size);
297300
return 0;
298301
}
299302

@@ -305,6 +308,9 @@ DenoiseState *rnnoise_create(RNNModel *model) {
305308
}
306309

307310
void rnnoise_destroy(DenoiseState *st) {
311+
free(st->rnn.vad_gru_state);
312+
free(st->rnn.noise_gru_state);
313+
free(st->rnn.denoise_gru_state);
308314
free(st);
309315
}
310316

0 commit comments

Comments
 (0)