Parcourir la source

libtorrunner: fix memory leak in child() error path

This avoids leaking memory in case libtorrunner's child() function fails.
Martin Kepplinger il y a 5 ans
Parent
commit
7ba1f39116
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      src/tools/tor_runner.c

+ 1 - 0
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 */