Skip to content

Commit 89303ec

Browse files
authored
Merge pull request #879 from igraph/fix/oom-handling-issues
2 parents a5c98da + 2494a88 commit 89303ec

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-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

src/_igraph/igraphmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ PyObject* igraphmodule__enter_safelocale(PyObject* self, PyObject* Py_UNUSED(_nu
784784
if (igraph_enter_safelocale(loc)) {
785785
Py_DECREF(capsule);
786786
igraphmodule_handle_igraph_error();
787+
return NULL;
787788
}
788789

789790
return capsule;

0 commit comments

Comments
 (0)