]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix memory leak in options_act_reversible: fix Coverity CID 486,487
authorNick Mathewson <nickm@torproject.org>
Thu, 6 Oct 2011 16:54:34 +0000 (12:54 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 26 Oct 2011 17:22:13 +0000 (13:22 -0400)
src/or/config.c

index 3080da0485f5caf78443c6711bf0531a58abb927..c5322f512092f2ab4e2e5ebd673ed93aa486c98b 100644 (file)
@@ -1077,8 +1077,11 @@ options_act_reversible(const or_options_t *old_options, char **msg)
     }
 
     /* Adjust the client port configuration so we can launch listeners. */
-    if (parse_client_ports(options, 0, msg, &n_client_ports))
-      return -1;
+    if (parse_client_ports(options, 0, msg, &n_client_ports)) {
+      if (!*msg)
+        *msg = tor_strdup("Unexpected problem parsing client port config");
+      goto rollback;
+    }
 
     /* Set the hibernation state appropriately.*/
     consider_hibernation(time(NULL));