Commit 5f634032 authored by Ho Yin Chan's avatar Ho Yin Chan
Browse files

trunk/src: minor fix of memory leak detected by valgrind for nnet-component-test

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@4336 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent bc7d684c
......@@ -133,6 +133,7 @@ void UnitTestGenericComponentInternal(const Component &component) {
KALDI_LOG << "Succeeded for " << num_ok << " out of " << num_tries
<< " tries.";
if (num_ok <= num_bad) {
delete component_copy;
KALDI_ERR << "Feature-derivative check failed";
}
}
......@@ -206,6 +207,7 @@ void UnitTestGenericComponentInternal(const Component &component) {
delete gradient_ucomponent;
}
if (num_ok < num_bad) {
delete component_copy;
KALDI_ERR << "model-derivative check failed";
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment