[En-Nut-Discussion] Chat module memory leaks

Louis Beaudoin deoxy at u.washington.edu
Tue May 11 21:24:04 CEST 2004


Hi all,

The chat module loses memory when using the "REPORT" command.  The 
report buffer is allocated more than once, and the report search buffer 
is not freed when the NUTCHAT structure is destroyed.

Additionally, the '^' character cannot be sent with the current code, 
and our modem, the Siemens MC56 uses this in AT commands.  I added 
support for this character by sending "\^"

Diff below

Thanks,
Louis Beaudoin

201a204,206
 >             case '^':
 >                 ch = '^';
 >                 break;
339a351,353
 >                 case '^':
 >                     *cp++ = '^';
 >                     break;
384c398
<         chat_report = malloc(CHAT_MAX_REPORT_SIZE+1);
---
 >         if(!chat_report)
384a399
 >             chat_report = malloc(CHAT_MAX_REPORT_SIZE+1);
429a445,446
 >         if(ci->chat_report_search)
 >             free(ci->chat_report_search);






More information about the En-Nut-Discussion mailing list