Make sure that the limit is N, not N - 1.
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 15 Jan 2010 20:58:19 +0000 (20:58 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 15 Jan 2010 20:58:19 +0000 (20:58 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240419 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 79102a8..344d844 100644 (file)
@@ -887,7 +887,7 @@ static int inprocess_count(const char *context, const char *mailbox, int delta)
                int ret = ast_atomic_fetchadd_int(&i->count, delta);
                ao2_unlock(inprocess_container);
                ao2_ref(i, -1);
-               return ret + delta;
+               return ret;
        }
        if (!(i = ao2_alloc(sizeof(*i) + strlen(context) + strlen(mailbox) + 2, NULL))) {
                ao2_unlock(inprocess_container);
@@ -900,7 +900,7 @@ static int inprocess_count(const char *context, const char *mailbox, int delta)
        ao2_link(inprocess_container, i);
        ao2_unlock(inprocess_container);
        ao2_ref(i, -1);
-       return delta;
+       return 0;
 }
 
 #if !(defined(ODBC_STORAGE) || defined(IMAP_STORAGE))