mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Fix two memory leaks found by Coverity (CIDs 417-418)
The first happens on an error case when a controller wants an impossible directory object. The second happens when we can't write our fingerprint file.
This commit is contained in:
parent
8bada1ef67
commit
5c73da7faa
@ -1536,6 +1536,7 @@ getinfo_helper_dir(control_connection_t *control_conn,
|
||||
if (res) {
|
||||
log_warn(LD_CONTROL, "getinfo '%s': %s", question, msg);
|
||||
smartlist_free(descs);
|
||||
tor_free(url);
|
||||
return -1;
|
||||
}
|
||||
SMARTLIST_FOREACH(descs, signed_descriptor_t *, sd,
|
||||
|
@ -588,6 +588,7 @@ init_keys(void)
|
||||
if (write_str_to_file(keydir, fingerprint_line, 0)) {
|
||||
log_err(LD_FS, "Error writing fingerprint line to file");
|
||||
tor_free(keydir);
|
||||
tor_free(cp);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user