diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-07-28 06:59:03 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-07-28 06:59:03 -0400 |
commit | a8676b1edecee2d1d472b7f67dd026ef7b084a2f (patch) | |
tree | d9ba30676becb8e03bbceaae9ba19a8288a2eb1d /src/test/test_scheduler.c | |
parent | f0488551e7be4e2d21a104903a86be993a240398 (diff) | |
parent | 47573038736b96e2a353a25ed3c788dcb77d8fcb (diff) | |
download | tor-a8676b1edecee2d1d472b7f67dd026ef7b084a2f.tar.gz tor-a8676b1edecee2d1d472b7f67dd026ef7b084a2f.zip |
Merge branch 'bug18902_squashed'
Diffstat (limited to 'src/test/test_scheduler.c')
-rw-r--r-- | src/test/test_scheduler.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/test_scheduler.c b/src/test/test_scheduler.c index 6d21d0344d..2e0736f99b 100644 --- a/src/test/test_scheduler.c +++ b/src/test/test_scheduler.c @@ -139,7 +139,7 @@ channel_flush_some_cells_mock_free_all(void) static void channel_flush_some_cells_mock_set(channel_t *chan, ssize_t num_cells) { - flush_mock_channel_t *flush_mock_ch = NULL; + int found = 0; if (!chan) return; if (num_cells <= 0) return; @@ -155,6 +155,7 @@ channel_flush_some_cells_mock_set(channel_t *chan, ssize_t num_cells) if (flush_mock_ch->chan == chan) { /* Found it */ flush_mock_ch->cells = num_cells; + found = 1; break; } } else { @@ -164,8 +165,9 @@ channel_flush_some_cells_mock_set(channel_t *chan, ssize_t num_cells) } } SMARTLIST_FOREACH_END(flush_mock_ch); - if (!flush_mock_ch) { + if (! found) { /* The loop didn't find it */ + flush_mock_channel_t *flush_mock_ch; flush_mock_ch = tor_malloc_zero(sizeof(*flush_mock_ch)); flush_mock_ch->chan = chan; flush_mock_ch->cells = num_cells; |