Commit 03da4480 by Vicent Marti

refcount: Fix off-by one error

parent 6632c155
......@@ -143,7 +143,7 @@ typedef void (*git_refcount_freeptr)(void *r);
#define GIT_REFCOUNT_DEC(_r, do_free) { \
git_refcount *r = (git_refcount *)(_r); \
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) { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment