]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
tor_runner.c: Add a circumlocution and a caveat.
authorNick Mathewson <nickm@torproject.org>
Wed, 1 Nov 2017 17:21:11 +0000 (13:21 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 1 Nov 2017 17:22:09 +0000 (13:22 -0400)
src/tools/tor_runner.c

index ac398742dc8b4a3676a5b765f01cfa8472ae2a61..9ed2ee5775291bd3c1139db1cf7e3fca9c518998 100644 (file)
  * practice.
  */
 
+/* NOTE: This module is supposed to work without the standard Tor utility
+ * functions.  Don't add more dependencies!
+ */
+
 #include "tor_api.h"
 #include "tor_api_internal.h"
 
@@ -73,12 +77,16 @@ tor_run_main(const tor_main_configuration_t *cfg)
   return -999988;
 }
 
+/* circumlocution to avoid getting warned about calling calloc instead of
+ * tor_calloc. */
+#define real_calloc calloc
+
 static void
 child(const tor_main_configuration_t *cfg)
 {
   /* XXXX Close unused file descriptors. */
 
-  char **args = calloc(cfg->argc+1, sizeof(char *));
+  char **args = real_calloc(cfg->argc+1, sizeof(char *));
   memcpy(args, cfg->argv, cfg->argc * sizeof(char *));
   args[cfg->argc] = NULL;