char * val;
val = getenv("ENV_VAR_NAME");
above is a code to get environment variable, will it cause memory leak if I dont free memory returned by getenv(char*) ? If no then please answer why?
No you shouldn't. Standard 7.20.4.5 says :
The getenv function returns a pointer to a string associated with the matched list member. The string pointed to shall not be modified by the program, but may be overwritten by a subsequent call to the getenv function.
I believe deletion is covered by the text in bold.