Fix memory leak.
[rsc] --rw-rw-r-- M 107020 glenda sys 6651 Nov 19 19:47 sys/src/lib9p/file.c
/n/sourcesdump/2005/1119/plan9/sys/src/lib9p/file.c:310,322 -
/n/sourcesdump/2005/1120/plan9/sys/src/lib9p/file.c:310,320
f = allocfile();
f->name = estrdup9p("/");
if(uid == nil){
- if(uid = getuser())
- uid = estrdup9p(uid);
+ uid = getuser();
+ if(uid == nil)
+ uid = "none";
}
- if(uid == nil)
- uid = estrdup9p("none");
- else
- uid = estrdup9p(uid);
+ uid = estrdup9p(uid);
if(gid == nil)
gid = estrdup9p(uid);
|