From 03da4480f665bcaf9a621ce8b89fc43dbc1d7a47 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Sat, 26 Nov 2011 08:31:15 +0100 Subject: [PATCH] refcount: Fix off-by one error --- src/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.h b/src/util.h index 2b239a0bf..094155e59 100644 --- a/src/util.h +++ b/src/util.h @@ -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) { \