Skip to content

Commit 5967b8e

Browse files
committed
fix: fixed memory leak in sample_degseq()
1 parent 5e1c7b4 commit 5967b8e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/rinterface_extra.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4968,6 +4968,7 @@ SEXP R_igraph_degree_sequence_game(SEXP pout_seq, SEXP pin_seq,
49684968
SEXP result;
49694969

49704970
R_SEXP_to_vector_int_copy(pout_seq, &outseq);
4971+
IGRAPH_FINALLY(igraph_vector_int_destroy, &outseq);
49714972
if (!Rf_isNull(pin_seq)) {
49724973
R_SEXP_to_vector_int_copy(pin_seq, &inseq);
49734974
} else {
@@ -4978,7 +4979,7 @@ SEXP R_igraph_degree_sequence_game(SEXP pout_seq, SEXP pin_seq,
49784979
PROTECT(result=R_igraph_to_SEXP(&g));
49794980
igraph_vector_int_destroy(&outseq);
49804981
igraph_vector_int_destroy(&inseq);
4981-
IGRAPH_FINALLY_CLEAN(1);
4982+
IGRAPH_FINALLY_CLEAN(2);
49824983
IGRAPH_I_DESTROY(&g);
49834984

49844985
UNPROTECT(1);

0 commit comments

Comments
 (0)