Summary: | ASTERISK-05912: [patch] memory leak in chan_sip.c:::build_rpid() | ||
Reporter: | Luigi Rizzo (rizzo) | Labels: | |
Date Opened: | 2005-12-28 04:08:13.000-0600 | Date Closed: | 2008-01-15 16:09:33.000-0600 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Core/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) build_rpid.diff | |
Description: | there is a couple of potential memory leaks in build_rpid(), because the local variables clid and clin allocate memory with strdup() which is never freed. i believe the fix is simply replacing the strdups with a pointer assignment, because the two strings are only used as readonly objects. Patch attached. | ||
Comments: | By: Russell Bryant (russell) 2005-12-28 10:38:09.000-0600 fixed in the 1.2 branch and trunk, thanks! By: Digium Subversion (svnbot) 2008-01-15 16:09:28.000-0600 Repository: asterisk Revision: 7665 U branches/1.2/channels/chan_sip.c ------------------------------------------------------------------------ r7665 | russell | 2008-01-15 16:09:28 -0600 (Tue, 15 Jan 2008) | 2 lines fix memory leak in build_rpid (issue ASTERISK-5912) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=7665 By: Digium Subversion (svnbot) 2008-01-15 16:09:29.000-0600 Repository: asterisk Revision: 7666 _U trunk/ U trunk/channels/chan_sip.c ------------------------------------------------------------------------ r7666 | russell | 2008-01-15 16:09:29 -0600 (Tue, 15 Jan 2008) | 10 lines Merged revisions 7665 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7665 | russell | 2005-12-28 12:35:56 -0500 (Wed, 28 Dec 2005) | 2 lines fix memory leak in build_rpid (issue ASTERISK-5912) ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=7666 By: Digium Subversion (svnbot) 2008-01-15 16:09:33.000-0600 Repository: asterisk Revision: 7670 _U team/crichter/0.3.0/ U team/crichter/0.3.0/apps/app_chanspy.c U team/crichter/0.3.0/apps/app_dictate.c U team/crichter/0.3.0/apps/app_queue.c U team/crichter/0.3.0/apps/app_voicemail.c U team/crichter/0.3.0/asterisk.c U team/crichter/0.3.0/channels/chan_iax2.c U team/crichter/0.3.0/channels/chan_sip.c U team/crichter/0.3.0/channels/iax2-provision.c U team/crichter/0.3.0/cli.c U team/crichter/0.3.0/manager.c U team/crichter/0.3.0/pbx.c ------------------------------------------------------------------------ r7670 | crichter | 2008-01-15 16:09:33 -0600 (Tue, 15 Jan 2008) | 76 lines Merged revisions 7655-7662,7664,7666-7668 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r7655 | russell | 2005-12-27 18:24:54 +0100 (Di, 27 Dez 2005) | 3 lines when doing tab completion, iterate the list of matches to count how many there are instead of having the list of matches generated twice (issue ASTERISK-5908) ................ r7656 | tilghman | 2005-12-27 18:53:48 +0100 (Di, 27 Dez 2005) | 2 lines Bug 5237 - Optional filename argument ................ r7657 | russell | 2005-12-27 19:18:41 +0100 (Di, 27 Dez 2005) | 3 lines avoid repeated calls to strlen in command completion functions and normalize some loops ................ r7658 | tilghman | 2005-12-27 20:13:13 +0100 (Di, 27 Dez 2005) | 2 lines Bug 4880 - add priority label matching and dialplan function retrieval ................ r7659 | russell | 2005-12-27 20:48:44 +0100 (Di, 27 Dez 2005) | 2 lines avoid unneeded calls to strlen in iax2 completion functions ................ r7660 | russell | 2005-12-27 20:59:09 +0100 (Di, 27 Dez 2005) | 3 lines avoid duplicate strlen calls for the command completion functions for 'show application' and 'show applications' ................ r7661 | russell | 2005-12-27 21:03:07 +0100 (Di, 27 Dez 2005) | 2 lines minor cleanups for another cli completion function ... ................ r7662 | russell | 2005-12-27 22:03:18 +0100 (Di, 27 Dez 2005) | 2 lines fix permissions of created recordings (issue ASTERISK-5909) ................ r7664 | russell | 2005-12-28 18:31:12 +0100 (Mi, 28 Dez 2005) | 2 lines restore alphabetical order for builtin cli commands (issue ASTERISK-5915) ................ r7666 | russell | 2005-12-28 18:37:35 +0100 (Mi, 28 Dez 2005) | 10 lines Merged revisions 7665 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7665 | russell | 2005-12-28 12:35:56 -0500 (Wed, 28 Dec 2005) | 2 lines fix memory leak in build_rpid (issue ASTERISK-5912) ........ ................ r7667 | russell | 2005-12-29 09:15:48 +0100 (Do, 29 Dez 2005) | 2 lines avoid multiple strlen calls in complete_queue ................ r7668 | russell | 2005-12-29 09:25:06 +0100 (Do, 29 Dez 2005) | 2 lines normalize a loop and avoid multiple strlen calls when completing voicemail users ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=7670 |