diff options
| author | christos <christos@NetBSD.org> | 2006-07-24 18:11:19 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2006-07-24 18:11:19 +0000 |
| commit | 3dbe70d84658d2d4db7cedc6667982ac0c040140 (patch) | |
| tree | 82610ab06a5e153e0a828ccb9000bfc5afaf0d9f /gnu | |
| parent | cf30106955bd25cb06749cabee5dae959f18688e (diff) | |
PR/34030: Takehiko NOZAKI: Allways allocate the cvs password returned
in the get_cvs_password() function to simplify the code and avoid leaks.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/dist/xcvs/src/client.c | 7 | ||||
| -rw-r--r-- | gnu/dist/xcvs/src/login.c | 3 |
2 files changed, 3 insertions, 7 deletions
diff --git a/gnu/dist/xcvs/src/client.c b/gnu/dist/xcvs/src/client.c index 188f92f2c2b..7f0168b8433 100644 --- a/gnu/dist/xcvs/src/client.c +++ b/gnu/dist/xcvs/src/client.c @@ -3936,11 +3936,8 @@ auth_server (root, lto_server, lfrom_server, verify_only, do_gssapi) send_to_server("\012", 1); /* Paranoia. */ - if (no_passwd) - { - memset (password, 0, strlen (password)); - free (password); - } + memset (password, 0, strlen (password)); + free (password); # else /* ! AUTH_CLIENT_SUPPORT */ error (1, 0, "INTERNAL ERROR: This client does not support pserver authentication"); # endif /* AUTH_CLIENT_SUPPORT */ diff --git a/gnu/dist/xcvs/src/login.c b/gnu/dist/xcvs/src/login.c index 2f1b4dcbef8..ac485c437cc 100644 --- a/gnu/dist/xcvs/src/login.c +++ b/gnu/dist/xcvs/src/login.c @@ -569,7 +569,6 @@ login (argc, argv) memset (typed_password, 0, strlen (typed_password)); free (typed_password); - memset (cvs_password, 0, strlen (cvs_password)); free (cvs_password); free (cvsroot_canonical); cvs_password = NULL; @@ -592,7 +591,7 @@ get_cvs_password () context, then assume they have supplied the correct, scrambled password. */ if (cvs_password) - return cvs_password; + return xstrdup (cvs_password); if (getenv ("CVS_PASSWORD") != NULL) { |
