The function ‘hpr_Initialize’ overwrites the code
returned by ‘ubik_ClientInit’. As a result, ‘hpr_Initialize’
will not report any failure triggered by ‘ubik_ClientInit’.
To fix this problem, store the code returned by ‘rxs_Release’
in a new variable. Only return this code if the function
‘ubik_ClientInit’ worked properly. Otherwise, return the code
provided by ‘ubik_ClientInit’.
Change-Id: I1820e3cbc2131daace01cec0464e56fd2982a783
Reviewed-on: http://gerrit.openafs.org/12137
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
afs_int32
hpr_Initialize(struct ubik_client **uclient)
{
- afs_int32 code;
+ afs_int32 code, code2;
struct rx_connection *serverconns[MAXSERVERS];
struct rx_securityClass *sc;
struct afsconf_dir *tdir;
ViceLog(0, ("hpr_Initialize: ubik client init failed. [%d]\n", code));
}
afsconf_Close(tdir);
- code = rxs_Release(sc);
+ code2 = rxs_Release(sc);
+
+ if (code == 0) {
+ code = code2;
+ }
return code;
}