Don't free until after externnotify (bug #1993)
authorMark Spencer <markster@digium.com>
Thu, 8 Jul 2004 16:24:16 +0000 (16:24 +0000)
committerMark Spencer <markster@digium.com>
Thu, 8 Jul 2004 16:24:16 +0000 (16:24 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3400 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 12363ac..d071765 100755 (executable)
@@ -3872,13 +3872,13 @@ out:
        }
        if (vmu)
                close_mailbox(&vms, vmu);
-       if (vmu)
-               free_user(vmu);
        if (valid) {
                snprintf(ext_context, sizeof(ext_context), "%s@%s", vms.username, vmu->context);
                manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s\r\nWaiting: %d\r\n", ext_context, ast_app_has_voicemail(ext_context));
                run_externnotify(chan->context, ext_context);
        }
+       if (vmu)
+               free_user(vmu);
        LOCAL_USER_REMOVE(u);
 
        return res;