cwfs: fix auth filedescriptor leak
This commit is contained in:
parent
a7a56b9a48
commit
474bc6a14a
1 changed files with 4 additions and 2 deletions
|
@ -103,7 +103,7 @@ authnew(void)
|
|||
return nil;
|
||||
}
|
||||
if(auth_rpc(rpc, "start", keyspec, strlen(keyspec)) != ARok){
|
||||
auth_freerpc(rpc);
|
||||
authfree(rpc);
|
||||
return nil;
|
||||
}
|
||||
return rpc;
|
||||
|
@ -114,8 +114,10 @@ authfree(void *auth)
|
|||
{
|
||||
AuthRpc *rpc;
|
||||
|
||||
if(rpc = auth)
|
||||
if(rpc = auth){
|
||||
close(rpc->afd);
|
||||
auth_freerpc(rpc);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in a new issue