Check return of init_keys() ip_address_changed: fix Coverity CID 484

This commit is contained in:
Nick Mathewson 2011-10-06 12:59:25 -04:00
parent 103c861dfe
commit 2412e0e402
2 changed files with 6 additions and 1 deletions

4
changes/cov484 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes:
- Report any failure in init_keys() calls done because our IP address
has changed. Spotted by Coverity Scan. Bugfix on 0.1.1.4-alpha;
fixes CID 484.

View File

@ -1378,7 +1378,8 @@ ip_address_changed(int at_interface)
if (at_interface) {
if (! server) {
/* Okay, change our keys. */
init_keys();
if (init_keys()<0)
log_warn(LD_GENERAL, "Unable to rotate keys after IP change!");
}
} else {
if (server) {