]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
scan-build: in cpuworker, initialize tv_start
authorNick Mathewson <nickm@torproject.org>
Sat, 19 Apr 2014 01:12:45 +0000 (21:12 -0400)
committerNick Mathewson <nickm@torproject.org>
Sat, 19 Apr 2014 01:12:45 +0000 (21:12 -0400)
scan-build doesn't realize that a request can't be timed at the end
unless it's timed at the start, and so it's not possible for us to
be subtracting start from end without start being set.
Nevertheless, let's not confuse it.

src/or/cpuworker.c

index 209274da64c556609f70b823f6d20896e5ecc525..6b6a68afe5411a13a52643cf9f5f9bd2a7d57b33 100644 (file)
@@ -436,7 +436,7 @@ cpuworker_main(void *data)
     if (req.task == CPUWORKER_TASK_ONION) {
       const create_cell_t *cc = &req.create_cell;
       created_cell_t *cell_out = &rpl.created_cell;
-      struct timeval tv_start, tv_end;
+      struct timeval tv_start = {0,0}, tv_end;
       int n;
       rpl.timed = req.timed;
       rpl.started_at = req.started_at;