Verify event is not NULL before attempting to lower its usecount.
authorTilghman Lesher <tilghman@meg.abyt.es>
Sat, 5 Jun 2010 17:27:12 +0000 (17:27 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Sat, 5 Jun 2010 17:27:12 +0000 (17:27 +0000)
(closes issue #17234)
 Reported by: mav3rick

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268454 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/manager.c

index b0b2d37..bf08e7e 100644 (file)
@@ -1222,7 +1222,9 @@ static void session_destructor(void *obj)
        if (session->f != NULL) {
                fclose(session->f);
        }
-       ast_atomic_fetchadd_int(&eqe->usecount, -1);
+       if (eqe) {
+               ast_atomic_fetchadd_int(&eqe->usecount, -1);
+       }
 }
 
 /*! \brief Allocate manager session structure and add it to the list of sessions */