Skip to content

Commit

Permalink
Only free the entry if it did not come from an iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
thecjharries committed Mar 17, 2018
1 parent df0e8b6 commit f48d0d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pygit2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ def _from_c(cls, ptr, from_iterator=False):
return entry

def __del__(self):
C.git_config_entry_free(self._entry)
if not self.from_iterator:
C.git_config_entry_free(self._entry)

@property
def value(self):
Expand Down

0 comments on commit f48d0d8

Please sign in to comment.