]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a memory leak on failure to create keys directory.
authorNick Mathewson <nickm@torproject.org>
Thu, 11 Apr 2019 22:18:14 +0000 (18:18 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 11 Apr 2019 22:18:14 +0000 (18:18 -0400)
Fixes bug 30148, which is also CID 1437429 and CID 1437454. Bugfix
on 0.3.3.1-alpha, when separate key directories became a thing.

changes/bug30148 [new file with mode: 0644]
src/or/routerkeys.c

diff --git a/changes/bug30148 b/changes/bug30148
new file mode 100644 (file)
index 0000000..7d0257e
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (memory leak):
+    - Avoid a minor memory leak that could occur on relays when
+      creating a keys directory failed. Fixes bug 30148; bugfix on
+      0.3.3.1-alpha.
index 43460da8cc35480270d390efe543ae7a67127518..dd19d28d051dba7d9059fcd8fb9e103f4a6f4bf2 100644 (file)
@@ -816,7 +816,7 @@ load_ed_keys(const or_options_t *options, time_t now)
 
     /* Check/Create the key directory */
     if (create_keys_directory(options) < 0)
-      return -1;
+      goto err;
 
     char *fname;
     if (options->master_key_fname) {
@@ -1403,4 +1403,3 @@ routerkeys_free_all(void)
   rsa_ed_crosscert = NULL; // redundant
   rsa_ed_crosscert_len = 0;
 }
-