Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gossipd: fix uninitialized free on short_route in goto path
Fix a path where tal_free is called on an uninitialized variable If the first `goto bad_total` executes, then that path has uninitialized `short_route` but bad_total passes through to `out` whose first call is tal_free(short_route). This was noticed by a maybe-uninitialized heuristic on gcc 7.4.0: gossipd/routing.c: In function ‘find_shorter_route’: gossipd/routing.c:1096:2: error: ‘short_route’ may be used uninitialized in this function [-Werror=maybe-uninitialized] tal_free(short_route); Reported-by: @ZmnSCPxj <ElementsProject#2674 (comment)> Signed-off-by: William Casarin <[email protected]>
- Loading branch information