P
parjit
Does the following code create a memory leak?
void main(){
char *something;
something=do_it("This is a test");
free(something);
}
char *do_it(char *str){
return(strdup(str));
}
I know that this example is idiotic, but it gets my question across, I
hope.
void main(){
char *something;
something=do_it("This is a test");
free(something);
}
char *do_it(char *str){
return(strdup(str));
}
I know that this example is idiotic, but it gets my question across, I
hope.