aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kepplinger <martink@posteo.de>2018-11-13 10:09:29 +0100
committerNick Mathewson <nickm@torproject.org>2018-11-14 07:49:51 -0500
commit7ba1f3911691d211a0297a4ec486d40c3d70bd8c (patch)
tree7def14d4b65d346e0f4624fef80bba83a3bdc79b
parent54d1a2d80537e9f9a90dcca18c9e616f73809f58 (diff)
downloadtor-7ba1f3911691d211a0297a4ec486d40c3d70bd8c.tar.gz
tor-7ba1f3911691d211a0297a4ec486d40c3d70bd8c.zip
libtorrunner: fix memory leak in child() error path
This avoids leaking memory in case libtorrunner's child() function fails.
-rw-r--r--src/tools/tor_runner.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tools/tor_runner.c b/src/tools/tor_runner.c
index 9ed2ee5775..7c43b0d244 100644
--- a/src/tools/tor_runner.c
+++ b/src/tools/tor_runner.c
@@ -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 */