]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix memory leaks in app_voicemail when using IMAP storage or realtime config
authorMatthew Jordan <mjordan@digium.com>
Wed, 5 Sep 2012 13:42:54 +0000 (13:42 +0000)
committerMatthew Jordan <mjordan@digium.com>
Wed, 5 Sep 2012 13:42:54 +0000 (13:42 +0000)
commit6129593e95e53cbbf62878bc3e32adb05983f603
tree90dc7c842cf98075f03833183be235720c81cf1f
parent5dac4f4eff9da018f80e68e6a4252229330618ed
Fix memory leaks in app_voicemail when using IMAP storage or realtime config

This patch fixes two memory leaks:

1. When find_user is called with NULL as its first parameter, the voicemail
   user returned is allocated on the heap.  The inboxcount2 function uses
   find_user in such a fashion when counting new messages, and fails to free
   the resulting voicemail user object.

2. When populate_defaults is called on a voicemail user, it wipes whatever
   flags have been set on the object by copying over the global flags object.
   If the VM_ALLOCED flag was ste on the voicemail user prior to doing so,
   that flag is removed.  This leaks the voicemail user when free_user is later
   called.

(closes issue ASTERISK-19155)
Reported by: Filip Jenicek
patches:
  asterisk.patch2 uploaded by Filip Jenicek (license 6277)

Patch slightly modified for this commit.

Review: https://reviewboard.asterisk.org/r/2096
........

Merged revisions 372268 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@372288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
apps/app_voicemail.c