mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 20:29:27 +00:00
refcount: Fix off-by one error
This commit is contained in:
parent
6632c15509
commit
03da4480f6
@ -143,7 +143,7 @@ typedef void (*git_refcount_freeptr)(void *r);
|
|||||||
#define GIT_REFCOUNT_DEC(_r, do_free) { \
|
#define GIT_REFCOUNT_DEC(_r, do_free) { \
|
||||||
git_refcount *r = (git_refcount *)(_r); \
|
git_refcount *r = (git_refcount *)(_r); \
|
||||||
r->refcount--; \
|
r->refcount--; \
|
||||||
if (r->refcount == 0 && r->owner == NULL) { do_free(_r); } \
|
if (r->refcount <= 0 && r->owner == NULL) { do_free(_r); } \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GIT_REFCOUNT_OWN(r, o) { \
|
#define GIT_REFCOUNT_OWN(r, o) { \
|
||||||
|
Loading…
Reference in New Issue
Block a user