Skip to content

Commit

Permalink
Merge pull request #11 from CAIDA/leak-communities
Browse files Browse the repository at this point in the history
Fix memory leak in get_communities_pyset()
  • Loading branch information
alistairking authored Apr 5, 2019
2 parents 394908e + 8536202 commit a743050
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/_pybgpstream_bgpelem.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ static PyObject *get_communities_pyset(bgpstream_community_set_t *communities)
}

/* add community to set */
PySet_Add(set, PYSTR_FROMSTR(comm_buf));
PyObject *pystr = PYSTR_FROMSTR(comm_buf);
PySet_Add(set, pystr); // does NOT steal reference
Py_DECREF(pystr);
}
return set;
}
Expand Down

0 comments on commit a743050

Please sign in to comment.