Skip to content

Commit 1b11041

Browse files
committed
fix: correct error handling in some OOM cases
1 parent 8d72bfc commit 1b11041

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/_igraph/graphobject.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5329,6 +5329,7 @@ PyObject *igraphmodule_Graph_edge_betweenness(igraphmodule_GraphObject * self,
53295329
igraph_vs_destroy(&sources);
53305330
if (weights) { igraph_vector_destroy(weights); free(weights); }
53315331
igraphmodule_handle_igraph_error();
5332+
return NULL;
53325333
}
53335334

53345335
if (cutoff == Py_None) {
@@ -5529,11 +5530,14 @@ PyObject *igraphmodule_Graph_feedback_arc_set(
55295530

55305531
if (igraph_vector_int_init(&res, 0)) {
55315532
if (weights) { igraph_vector_destroy(weights); free(weights); }
5533+
igraphmodule_handle_igraph_error();
5534+
return NULL;
55325535
}
55335536

55345537
if (igraph_feedback_arc_set(&self->g, &res, weights, algo)) {
55355538
if (weights) { igraph_vector_destroy(weights); free(weights); }
55365539
igraph_vector_int_destroy(&res);
5540+
igraphmodule_handle_igraph_error();
55375541
return NULL;
55385542
}
55395543

@@ -5571,11 +5575,14 @@ PyObject *igraphmodule_Graph_feedback_vertex_set(
55715575

55725576
if (igraph_vector_int_init(&res, 0)) {
55735577
if (weights) { igraph_vector_destroy(weights); free(weights); }
5578+
igraphmodule_handle_igraph_error();
5579+
return NULL;
55745580
}
55755581

55765582
if (igraph_feedback_vertex_set(&self->g, &res, weights, algo)) {
55775583
if (weights) { igraph_vector_destroy(weights); free(weights); }
55785584
igraph_vector_int_destroy(&res);
5585+
igraphmodule_handle_igraph_error();
55795586
return NULL;
55805587
}
55815588

0 commit comments

Comments
 (0)