mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 10:50:07 +00:00
Update.
* inet/rexec.c (rexec): Free memory if strings were allocated in ruserpass. Reported by Andrew Morton <morton@nortelnetworks.com>. 1999-08-27 Ulrich Drepper <drepper@cygnus.com>
This commit is contained in:
parent
4744a4116a
commit
8a3c844357
@ -1,3 +1,8 @@
|
||||
1999-08-27 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* inet/rexec.c (rexec): Free memory if strings were allocated in
|
||||
ruserpass. Reported by Andrew Morton <morton@nortelnetworks.com>.
|
||||
|
||||
1999-08-27 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* locale/categories.def: Use __YESSTR amd __NOSTR in definition.
|
||||
|
10
inet/rexec.c
10
inet/rexec.c
@ -54,6 +54,8 @@ rexec(ahost, rport, name, pass, cmd, fd2p)
|
||||
{
|
||||
struct sockaddr_in sin, sin2, from;
|
||||
struct hostent hostbuf, *hp;
|
||||
const char *orig_name = name;
|
||||
const char *orig_pass = pass;
|
||||
size_t hstbuflen;
|
||||
char *hsttmpbuf;
|
||||
u_short port;
|
||||
@ -138,6 +140,14 @@ retry:
|
||||
/* should public key encypt the password here */
|
||||
(void) __write(s, pass, strlen(pass) + 1);
|
||||
(void) __write(s, cmd, strlen(cmd) + 1);
|
||||
|
||||
/* We don't need the memory allocated for the name and the password
|
||||
in ruserpass anymore. */
|
||||
if (name != orig_name)
|
||||
free (name);
|
||||
if (pass != orig_pass)
|
||||
free (pass);
|
||||
|
||||
if (__read(s, &c, 1) != 1) {
|
||||
perror(*ahost);
|
||||
goto bad;
|
||||
|
Loading…
Reference in New Issue
Block a user