From: Nick Mathewson Date: Tue, 27 Oct 2009 02:12:40 +0000 (-0400) Subject: Fix two memory leaks found by Coverity (CIDs 417-418) X-Git-Tag: tor-0.2.2.6-alpha~29^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c73da7faad1537f63c0f9923a25f3dda9df0de1;p=thirdparty%2Ftor.git 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. --- diff --git a/src/or/control.c b/src/or/control.c index 5688b8e71f..f0178d74a9 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -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, diff --git a/src/or/router.c b/src/or/router.c index fcfbe79112..dab4cb8938 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -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; } }