Fix memory leak in app_queue when a device state is changed but it isn't
authorBrett Bryant <bbryant@digium.com>
Tue, 15 Jul 2008 18:14:02 +0000 (18:14 +0000)
committerBrett Bryant <bbryant@digium.com>
Tue, 15 Jul 2008 18:14:02 +0000 (18:14 +0000)
a member of any queue.

(closes issue #13073)
Reported by: eliel
Patches:
      app_queue.c.patch uploaded by eliel (license 64)

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

apps/app_queue.c

index 61630d1..fef9685 100644 (file)
@@ -782,6 +782,7 @@ static int handle_statechange(void *datap)
        if (!curint) {
                if (option_debug > 2)
                        ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s) but we don't care because they're not a member of any queue.\n", technology, loc, sc->state, devstate2str(sc->state));
        if (!curint) {
                if (option_debug > 2)
                        ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s) but we don't care because they're not a member of any queue.\n", technology, loc, sc->state, devstate2str(sc->state));
+               ast_free(sc);
                return 0;
        }
 
                return 0;
        }