Click here to Skip to main content
15,917,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Remote-Access to another PC Pin
benjymous12-Jan-03 23:41
benjymous12-Jan-03 23:41 
Generalwarning and memory leak! Pin
r i s h a b h s12-Jan-03 20:29
r i s h a b h s12-Jan-03 20:29 
GeneralRe: warning and memory leak! Pin
Joaquín M López Muñoz12-Jan-03 21:23
Joaquín M López Muñoz12-Jan-03 21:23 
GeneralRe: warning and memory leak! Pin
r i s h a b h s12-Jan-03 21:43
r i s h a b h s12-Jan-03 21:43 
GeneralRe: warning and memory leak! Pin
Joaquín M López Muñoz12-Jan-03 21:50
Joaquín M López Muñoz12-Jan-03 21:50 
GeneralRe: warning and memory leak! Pin
r i s h a b h s12-Jan-03 21:58
r i s h a b h s12-Jan-03 21:58 
Generalcan any one help me with the memory leak Pin
r i s h a b h s12-Jan-03 23:16
r i s h a b h s12-Jan-03 23:16 
GeneralRe: can any one help me with the memory leak Pin
Alvaro Mendez13-Jan-03 4:34
Alvaro Mendez13-Jan-03 4:34 
You need to look at the possibility of the function exiting before delete is called. From your code it looks like if an exception is thrown that's what happens; you catch it, and then return without freeing inp.

You may want to consider not allocating inp dynamically since it's always got a constant size (MAXCHARS).

char inp[MAXCHARS];

Another alternative is to dynamically allocate it, but on the stack using alloca:

char* inp = (char*)alloca(MAXCHARS);

Then you don't need to worry about explicitly freeing it since it will happen automatically.

Regards,
Alvaro


All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
GeneralRe: can any one help me with the memory leak Pin
Daniel Turini13-Jan-03 4:53
Daniel Turini13-Jan-03 4:53 
GeneralRe: can any one help me with the memory leak Pin
Tim Smith13-Jan-03 6:45
Tim Smith13-Jan-03 6:45 
GeneralGraphics Pin
chepuri_uk12-Jan-03 19:53
chepuri_uk12-Jan-03 19:53 
GeneralRe: Graphics Pin
includeh1013-Jan-03 0:06
includeh1013-Jan-03 0:06 
GeneralDiscovering DLLs Functions and Parameters Pin
Huttami12-Jan-03 19:34
Huttami12-Jan-03 19:34 
GeneralRe: Discovering DLLs Functions and Parameters Pin
includeh1013-Jan-03 0:15
includeh1013-Jan-03 0:15 
GeneralRe: Discovering DLLs Functions and Parameters Pin
Martyn Pearson13-Jan-03 3:19
Martyn Pearson13-Jan-03 3:19 
GeneralRe: Discovering DLLs Functions and Parameters Pin
Anonymous14-Jan-03 3:46
Anonymous14-Jan-03 3:46 
GeneralRe: Re Discovering DLLs Functions and Parameters Pin
Anonymous14-Jan-03 3:55
Anonymous14-Jan-03 3:55 
QuestionAny ideas? Pin
Joshua Nussbaum12-Jan-03 19:21
Joshua Nussbaum12-Jan-03 19:21 
AnswerRe: Any ideas? Pin
Moak12-Jan-03 19:37
Moak12-Jan-03 19:37 
AnswerRe: Any ideas? Pin
Nitron13-Jan-03 3:38
Nitron13-Jan-03 3:38 
GeneralWants to develop Intrusion Detection System(IDS) Pin
summo12-Jan-03 19:05
summo12-Jan-03 19:05 
GeneralRe: Wants to develop Intrusion Detection System(IDS) Pin
geo_m13-Jan-03 0:21
geo_m13-Jan-03 0:21 
GeneralRe: Wants to develop Intrusion Detection System(IDS) Pin
Dana Epp15-Jan-03 9:09
Dana Epp15-Jan-03 9:09 
GeneralTemporal position of pMainFrame->LoadFrame & DialogBar Control Updates... Pin
JennyP12-Jan-03 18:52
JennyP12-Jan-03 18:52 
GeneralRe: Temporal position of pMainFrame->LoadFrame & DialogBar Control Updates... Pin
jhwurmbach12-Jan-03 22:52
jhwurmbach12-Jan-03 22:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.