linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Any problem ?
@ 2011-01-28 11:53 ratheesh k
  2011-01-28 12:02 ` Santosh Sivaraj
       [not found] ` <AANLkTimg=+0jUVjyG2Zq7ZqC=A5XbjWfkjoJADmPsULK@mail.gmail.com>
  0 siblings, 2 replies; 4+ messages in thread
From: ratheesh k @ 2011-01-28 11:53 UTC (permalink / raw)
  To: linux-c-programming

Is there any problem with this below code ? I just want to free memory.


void free_it(char *ptr)
{
 free(ptr);
}


int main()
{
char *str = (char *)malloc(100);
strcpy(str, "Ratheesh");
free_it(str);
str=NULL;
return 0;
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-28 21:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-28 11:53 Any problem ? ratheesh k
2011-01-28 12:02 ` Santosh Sivaraj
     [not found] ` <AANLkTimg=+0jUVjyG2Zq7ZqC=A5XbjWfkjoJADmPsULK@mail.gmail.com>
2011-01-28 20:46   ` Leon Romanovsky
2011-01-28 21:01     ` David Astua

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).