I have this code:
int tim=10000; // some random number tm *now=localtime(&tim); printf("Date is %d/%02d/%02d\n", now->tm_year+1900, now->tm_mon+1, now->tm_mday); printf("Time is %02d:%02d\n", now->tm_hour, now->tm_min);
The reason I'm wondering if there is a memory leak is because localtime returns a pointer to the structure, which means memory allocation. but no one lets him out.
Is there a memory leak in this code?
source share