mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-26 15:42:34 +01:00
Coverity: fix memory leak on error in test function.
The function make_intro_from_plaintext() in test_introduce.c would leak memory if we ever hit a failure from our underlying crypto functions. This kind of failure should be impossible, but it's best to be safe here. Bugfix on 0.2.4.1-alpha.
This commit is contained in:
parent
5fa2b32200
commit
ea154a6108
1 changed files with 2 additions and 1 deletions
|
@ -383,8 +383,10 @@ make_intro_from_plaintext(
|
||||||
|
|
||||||
/* Output the cell */
|
/* Output the cell */
|
||||||
*cell_out = cell;
|
*cell_out = cell;
|
||||||
|
cell = NULL;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
tor_free(cell);
|
||||||
return cell_len;
|
return cell_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,4 +537,3 @@ struct testcase_t introduce_tests[] = {
|
||||||
INTRODUCE_LEGACY(late_parse_v3),
|
INTRODUCE_LEGACY(late_parse_v3),
|
||||||
END_OF_TESTCASES
|
END_OF_TESTCASES
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue