will I get Memory leak..
- From: gNash <ganeshamutha@xxxxxxxxx>
- Date: Wed, 14 Nov 2007 12:31:22 -0000
Hi all,
void main()
{
char *fp;
fp=malloc(26);
strcpy(fp,"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
fp[10]='\0';
free(fp);
}
Please refer the program for my questions..
1. Can any one tell me if would i assign '\0' at middle of
dynamically assigned memory area will i get memory leak.. ??
2 . Will "free()" delete all the memory which allocated by
dynamically even NULL values has been added in middle of that.??
3. How let i know that will i get memory leak in a program?? any
compiler option are there ?? Can i use splint tool ?
Thanks,
Ganesh
.
- Follow-Ups:
- Re: will I get Memory leak..
- From: Martin Ambuhl
- Re: will I get Memory leak..
- From: Mark Bluemel
- Re: will I get Memory leak..
- From: James Kuyper
- Re: will I get Memory leak..
- From: Ben Bacarisse
- Re: will I get Memory leak..
- From: Spiros Bousbouras
- Re: will I get Memory leak..
- From: Richard Bos
- Re: will I get Memory leak..
- Prev by Date: Re: What does near intialization mean
- Next by Date: Re: problem understanding c code
- Previous by thread: problem understanding c code
- Next by thread: Re: will I get Memory leak..
- Index(es):
Relevant Pages
|