@@ -101,10 +101,6 @@ bool dijkstra_path(const tal_t *ctx, const struct graph *graph,
101101 bitmap * visited = tal_arrz (this_ctx , bitmap ,
102102 BITMAP_NWORDS (max_num_nodes ));
103103
104- if (!visited )
105- /* bad allocation */
106- goto finish ;
107-
108104 for (size_t i = 0 ; i < max_num_nodes ; ++ i )
109105 prev [i ].idx = INVALID_INDEX ;
110106
@@ -158,7 +154,6 @@ bool dijkstra_path(const tal_t *ctx, const struct graph *graph,
158154 for (size_t i = 0 ; i < max_num_nodes ; i ++ )
159155 distance [i ] = dijkstra_distance [i ];
160156
161- finish :
162157 tal_free (this_ctx );
163158 return target_found ;
164159}
@@ -357,10 +352,6 @@ static struct node dijkstra_nearest_sink(const tal_t *ctx,
357352 struct node target = {.idx = INVALID_INDEX };
358353 const tal_t * this_ctx = tal (ctx , tal_t );
359354
360- if (!this_ctx )
361- /* bad allocation */
362- goto finish ;
363-
364355 /* check preconditions */
365356 assert (graph );
366357 assert (node_balance );
@@ -405,7 +396,6 @@ static struct node dijkstra_nearest_sink(const tal_t *ctx,
405396#ifdef ASKRENE_UNITTEST
406397 bitmap * visited =
407398 tal_arrz (this_ctx , bitmap , BITMAP_NWORDS (max_num_nodes ));
408- assert (visited );
409399#endif
410400
411401 struct priorityqueue * q ;
@@ -510,10 +500,6 @@ bool mcf_refinement(const tal_t *ctx,
510500 bool solved = false;
511501 const tal_t * this_ctx = tal (ctx , tal_t );
512502
513- if (!this_ctx )
514- /* bad allocation */
515- goto finish ;
516-
517503 assert (graph );
518504 assert (excess );
519505 assert (capacity );
@@ -627,9 +613,6 @@ bool simple_mcf(const tal_t *ctx, const struct graph *graph,
627613 s64 * capacity , s64 amount , const s64 * cost )
628614{
629615 const tal_t * this_ctx = tal (ctx , tal_t );
630- if (!this_ctx )
631- /* bad allocation */
632- goto fail ;
633616
634617 assert (graph );
635618 const size_t max_num_arcs = graph_max_num_arcs (graph );
@@ -647,10 +630,6 @@ bool simple_mcf(const tal_t *ctx, const struct graph *graph,
647630 s64 * potential = tal_arrz (this_ctx , s64 , max_num_nodes );
648631 s64 * excess = tal_arrz (this_ctx , s64 , max_num_nodes );
649632
650- if (!potential || !excess )
651- /* bad allocation */
652- goto fail ;
653-
654633 excess [source .idx ] = amount ;
655634 excess [destination .idx ] = - amount ;
656635
0 commit comments