I\'m supporting some c code on Solaris, and I\'ve seen something weird at least I think it is:
char new_login[64];
...
strcpy(new_login, (char *)login);
...
The free() is definitely a bug.
However, it's possible there's another bug here:
strcpy(new_login, (char *)login);
new_login[sizeof(new_login)-1]='\0';
strncpy(new_login, (char *)login, sizeof(new_login)-1 );