Summary: | ASTERISK-10070: memory leak in zt_new() | ||
Reporter: | HÃ¥kan Lindell (haklin) | Labels: | |
Date Opened: | 2007-08-13 07:33:53 | Date Closed: | 2008-01-09 12:30:22.000-0600 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Channels/chan_zap |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ||
Description: | zt_new() calls ast_channel_alloc() with cid_num, cid_name but later in zt_new(), the following code is executed, which overwrites cid-stuff in the "tmp-channel": #ifdef PRI_ANI tmp->cid.cid_num = ast_strdup(i->cid_num); tmp->cid.cid_name = ast_strdup(i->cid_name); if (!ast_strlen_zero(i->cid_ani)) tmp->cid.cid_ani = ast_strdup(i->cid_ani); else tmp->cid.cid_ani = ast_strdup(i->cid_num); #else tmp->cid.cid_num = ast_strdup(i->cid_num); tmp->cid.cid_ani = ast_strdup(i->cid_num); tmp->cid.cid_name = ast_strdup(i->cid_name); #endif In ast_channel_alloc() cid_num and cid_name are already set and a memory leak occurs when the ast_strdup() above is executed. | ||
Comments: | By: Digium Subversion (svnbot) 2007-08-13 09:00:22 Repository: asterisk Revision: 79174 ------------------------------------------------------------------------ r79174 | file | 2007-08-13 09:00:21 -0500 (Mon, 13 Aug 2007) | 4 lines (closes issue ASTERISK-10070) Reported by: haklin Don't set the callerid name and number a second time on a newly created channel. ast_channel_alloc itself already sets it and setting it twice would cause a memory leak. ------------------------------------------------------------------------ By: Digium Subversion (svnbot) 2007-08-13 09:05:04 Repository: asterisk Revision: 79175 ------------------------------------------------------------------------ r79175 | file | 2007-08-13 09:05:03 -0500 (Mon, 13 Aug 2007) | 12 lines Merged revisions 79174 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r79174 | file | 2007-08-13 11:18:04 -0300 (Mon, 13 Aug 2007) | 4 lines (closes issue ASTERISK-10070) Reported by: haklin Don't set the callerid name and number a second time on a newly created channel. ast_channel_alloc itself already sets it and setting it twice would cause a memory leak. ........ ------------------------------------------------------------------------ By: Digium Subversion (svnbot) 2008-01-09 10:55:19.000-0600 Repository: asterisk Revision: 97489 U branches/1.4/channels/chan_gtalk.c ------------------------------------------------------------------------ r97489 | phsultan | 2008-01-09 10:55:18 -0600 (Wed, 09 Jan 2008) | 7 lines Set the caller id within the gtalk_alloc function. As underlined in issue ASTERISK-10070 by Josh, we need to prevent a possible memory leak. We only set the name part of the caller id, the number part is not relevant when dealing with JIDs. Closes issue ASTERISK-11037. ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=97489 By: Digium Subversion (svnbot) 2008-01-09 10:55:22.000-0600 Repository: asterisk Revision: 97490 _U trunk/ U trunk/channels/chan_gtalk.c ------------------------------------------------------------------------ r97490 | phsultan | 2008-01-09 10:55:22 -0600 (Wed, 09 Jan 2008) | 15 lines Merged revisions 97489 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97489 | phsultan | 2008-01-09 17:44:24 +0100 (Wed, 09 Jan 2008) | 7 lines Set the caller id within the gtalk_alloc function. As underlined in issue ASTERISK-10070 by Josh, we need to prevent a possible memory leak. We only set the name part of the caller id, the number part is not relevant when dealing with JIDs. Closes issue ASTERISK-11037. ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=97490 By: Digium Subversion (svnbot) 2008-01-09 12:30:22.000-0600 Repository: asterisk Revision: 97556 _U team/murf/bug11210/ U team/murf/bug11210/apps/app_meetme.c U team/murf/bug11210/apps/app_queue.c U team/murf/bug11210/apps/app_voicemail.c U team/murf/bug11210/channels/Makefile U team/murf/bug11210/channels/chan_gtalk.c U team/murf/bug11210/channels/chan_oss.c U team/murf/bug11210/channels/chan_zap.c A team/murf/bug11210/channels/console_board.c U team/murf/bug11210/channels/console_gui.c U team/murf/bug11210/channels/console_video.c U team/murf/bug11210/channels/console_video.h U team/murf/bug11210/codecs/codec_zap.c A team/murf/bug11210/images/font.png U team/murf/bug11210/images/kpad2.jpg U team/murf/bug11210/main/asterisk.c U team/murf/bug11210/main/cli.c U team/murf/bug11210/main/editline/readline.c U team/murf/bug11210/res/res_features.c ------------------------------------------------------------------------ r97556 | murf | 2008-01-09 12:30:19 -0600 (Wed, 09 Jan 2008) | 245 lines Merged revisions 97280-97282,97303,97305,97307,97309,97364-97365,97389-97390,97421,97449,97451,97488,97490,97495,97530-97533 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r97280 | rizzo | 2008-01-08 16:09:44 -0700 (Tue, 08 Jan 2008) | 11 lines add support for textareas, used for various dialog windows on the gui. The main code to implement the textarea is in console_board.c, and uses a simple png image with the font, blitting characters on the designated areas of the main screen. Additionally we provide some annotations in the image used as a skin to indicate which areas are used for text messages. (images will be committed separately). At the moment the dialog area is only used to display a running counter, just as a proof of concept. ................ r97281 | rizzo | 2008-01-08 16:11:25 -0700 (Tue, 08 Jan 2008) | 5 lines add a font suitable for use with the console GUI. The background of this particular image is transparent so we can preserve the original background when we draw strings. ................ r97282 | rizzo | 2008-01-08 16:14:48 -0700 (Tue, 08 Jan 2008) | 6 lines Add the annotation for the textarea used for messages, and also change the background from white to something different to show that we can make use of fonts with transparent background. ................ r97303 | rizzo | 2008-01-08 16:35:05 -0700 (Tue, 08 Jan 2008) | 4 lines add copyright (most of this code was written by Marta Carbone), remove some unused code, add/clarify some comments. ................ r97305 | tilghman | 2008-01-08 16:51:51 -0700 (Tue, 08 Jan 2008) | 6 lines Add a new flag 'd' (with optional context) permitting any extension within that context to be entered as a new extension during the playback of a voicemail greeting. Patch inspired by bluecrow76, by tilghman. (Closes issue ASTERISK-6878) ................ r97307 | mmichelson | 2008-01-08 16:56:24 -0700 (Tue, 08 Jan 2008) | 13 lines Merged revisions 97304 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97304 | mmichelson | 2008-01-08 17:49:11 -0600 (Tue, 08 Jan 2008) | 5 lines Part 1 of N of adding doxygen comments to app_queue. I picked some of the most common functions used (which also happen to be some the biggest/ugliest functions too) to document first. I'm pretty new to doxygen so criticism is welcome. ........ ................ r97309 | mmichelson | 2008-01-08 17:18:15 -0700 (Tue, 08 Jan 2008) | 11 lines Merged revisions 97308 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97308 | mmichelson | 2008-01-08 18:17:40 -0600 (Tue, 08 Jan 2008) | 3 lines use the etval doxygen command properly ........ ................ r97364 | tilghman | 2008-01-08 17:51:59 -0700 (Tue, 08 Jan 2008) | 13 lines Merged revisions 97350 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97350 | tilghman | 2008-01-08 18:44:14 -0600 (Tue, 08 Jan 2008) | 5 lines Allow filename completion on zero-length modules, remove a memory leak, remove a file descriptor leak, and make filename completion thread-safe. Patched and tested by tilghman. (Closes issue ASTERISK-11153) ........ ................ r97365 | tilghman | 2008-01-08 17:58:22 -0700 (Tue, 08 Jan 2008) | 2 lines New option in trunk, needs strdupa to be safe, too ................ r97389 | rizzo | 2008-01-09 05:13:32 -0700 (Wed, 09 Jan 2008) | 4 lines make get_video_desc() return the active console if passed a null argument (channel). ................ r97390 | rizzo | 2008-01-09 05:23:18 -0700 (Wed, 09 Jan 2008) | 7 lines implement the "console startgui" and "console stopgui" commands so you can start and stop the gui even outside of a call. This is convenient for testing, and also for using the keypad to pick up a call, and to dial a number (the latter not yet implemented, but should be close). ................ r97421 | kpfleming | 2008-01-09 08:31:56 -0700 (Wed, 09 Jan 2008) | 10 lines Merged revisions 97410 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97410 | kpfleming | 2008-01-09 09:26:23 -0600 (Wed, 09 Jan 2008) | 2 lines add error number output to ioctl failure messages to help with debugging ........ ................ r97449 | kpfleming | 2008-01-09 08:45:34 -0700 (Wed, 09 Jan 2008) | 10 lines Merged revisions 97448 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97448 | kpfleming | 2008-01-09 09:43:19 -0600 (Wed, 09 Jan 2008) | 2 lines pass the right variable to get an error string... oops ........ ................ r97451 | file | 2008-01-09 09:13:24 -0700 (Wed, 09 Jan 2008) | 14 lines Merged revisions 97450 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97450 | file | 2008-01-09 12:11:17 -0400 (Wed, 09 Jan 2008) | 6 lines Don't do conferencing totally in Zaptel if Monitor is running on the channel. (closes issue ASTERISK-11179) Reported by: BigJimmy Patches: patch-meetmerec uploaded by BigJimmy (license 371) ........ ................ r97488 | rizzo | 2008-01-09 09:44:20 -0700 (Wed, 09 Jan 2008) | 8 lines Implement keyboard handling, and use it to enter a number to dial in the 'message' area under the keypad. Now you can make calls using the keypad as a regular phone (or the keyboard for chars not present on the keypad) ................ r97490 | phsultan | 2008-01-09 09:59:09 -0700 (Wed, 09 Jan 2008) | 15 lines Merged revisions 97489 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97489 | phsultan | 2008-01-09 17:44:24 +0100 (Wed, 09 Jan 2008) | 7 lines Set the caller id within the gtalk_alloc function. As underlined in issue ASTERISK-10070 by Josh, we need to prevent a possible memory leak. We only set the name part of the caller id, the number part is not relevant when dealing with JIDs. Closes issue ASTERISK-11037. ........ ................ r97495 | kpfleming | 2008-01-09 10:30:13 -0700 (Wed, 09 Jan 2008) | 10 lines Merged revisions 97491 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97491 | kpfleming | 2008-01-09 11:21:14 -0600 (Wed, 09 Jan 2008) | 2 lines report the same message whether Zaptel does not have transcoder support loaded or no transcoders were found ........ ................ r97530 | rizzo | 2008-01-09 11:03:40 -0700 (Wed, 09 Jan 2008) | 11 lines Two changes: - support scrolling of message window; - simplify the code for creating a message window, and try it using a second one in the top of the keypad (where we echo the dialed number). The 'skin' that supports these two windows will be committed separately. ................ r97531 | russell | 2008-01-09 11:04:14 -0700 (Wed, 09 Jan 2008) | 10 lines Merged revisions 97529 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97529 | russell | 2008-01-09 12:02:08 -0600 (Wed, 09 Jan 2008) | 2 lines Fix saying the parking space number to the caller doing the parking ... ........ ................ r97532 | rizzo | 2008-01-09 11:04:17 -0700 (Wed, 09 Jan 2008) | 4 lines add annotations for the two message windows we use. ................ r97533 | rizzo | 2008-01-09 11:12:44 -0700 (Wed, 09 Jan 2008) | 3 lines remove a wrong 'const' ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=97556 |