> As long as the returns from getpwnam are used "soon", i.e. before any > further calls to getpwnam, > this kind of code is fine. If that's not the case, then you should copy > both the struct and all the > strings it points to somewhere. i had this bug for a while - getgrent() two-level loops (oops!)