Index: mount.cifs.c =================================================================== --- mount.cifs.c (revision 16149) +++ mount.cifs.c (working copy) @@ -117,7 +117,9 @@ exit(1); } -/* caller frees username if necessary */ +/* The username returned from getusername should not be free'd, and may be + * overwritten by subsequent calls to getusername or the getpw* functions + * from libc */ static char * getusername(void) { char *username = NULL; struct passwd *password = getpwuid(getuid()); @@ -1241,7 +1243,6 @@ strcat(mountent.mnt_opts,",user="); strcat(mountent.mnt_opts,mount_user); } - free(mount_user); } } mountent.mnt_freq = 0;