From e08409271e07dc10e8249923d3658413ddb25cb7 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 6 Feb 2018 16:59:56 +0100 Subject: [PATCH 1/1] Please scan-build. --- examples/s4u/app-bittorrent/s4u-tracker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/s4u/app-bittorrent/s4u-tracker.cpp b/examples/s4u/app-bittorrent/s4u-tracker.cpp index 129667980e..b3f29a00fa 100644 --- a/examples/s4u/app-bittorrent/s4u-tracker.cpp +++ b/examples/s4u/app-bittorrent/s4u-tracker.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017. The SimGrid Team. +/* Copyright (c) 2012-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -32,12 +32,13 @@ Tracker::Tracker(std::vector args) void Tracker::operator()() { simgrid::s4u::CommPtr comm = nullptr; - void* received; + void* received = nullptr; while (simgrid::s4u::Engine::getClock() < deadline) { if (comm == nullptr) comm = mailbox->get_async(&received); if (comm->test()) { // Retrieve the data sent by the peer. + xbt_assert(received != nullptr); TrackerQuery* tq = static_cast(received); // Add the peer to our peer list, if not already known. -- 2.20.1