]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
libtorrunner: fix memory leak in child() error path
authorMartin Kepplinger <martink@posteo.de>
Tue, 13 Nov 2018 09:09:29 +0000 (10:09 +0100)
committerNick Mathewson <nickm@torproject.org>
Wed, 14 Nov 2018 12:49:51 +0000 (07:49 -0500)
This avoids leaking memory in case libtorrunner's child() function fails.

src/tools/tor_runner.c

index 9ed2ee5775291bd3c1139db1cf7e3fca9c518998..7c43b0d2449f64aff4964d02f91b7ba16d6efdda 100644 (file)
@@ -93,6 +93,7 @@ child(const tor_main_configuration_t *cfg)
   int rv = execv(BINDIR "/tor", args);
 
   if (rv < 0) {
+    free(args);
     exit(254);
   } else {
     abort(); /* Unreachable */