diff options
Diffstat (limited to 'ssh-agent.c')
-rw-r--r-- | ssh-agent.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ssh-agent.c b/ssh-agent.c index 7feb898dd..67bde5560 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -109,8 +109,8 @@ int max_fd = 0; | |||
109 | pid_t parent_pid = -1; | 109 | pid_t parent_pid = -1; |
110 | 110 | ||
111 | /* pathname and directory for AUTH_SOCKET */ | 111 | /* pathname and directory for AUTH_SOCKET */ |
112 | char socket_name[1024]; | 112 | char socket_name[MAXPATHLEN]; |
113 | char socket_dir[1024]; | 113 | char socket_dir[MAXPATHLEN]; |
114 | 114 | ||
115 | /* locking */ | 115 | /* locking */ |
116 | int locked = 0; | 116 | int locked = 0; |
@@ -803,10 +803,7 @@ new_socket(sock_type type, int fd) | |||
803 | } | 803 | } |
804 | old_alloc = sockets_alloc; | 804 | old_alloc = sockets_alloc; |
805 | new_alloc = sockets_alloc + 10; | 805 | new_alloc = sockets_alloc + 10; |
806 | if (sockets) | 806 | sockets = xrealloc(sockets, new_alloc * sizeof(sockets[0])); |
807 | sockets = xrealloc(sockets, new_alloc * sizeof(sockets[0])); | ||
808 | else | ||
809 | sockets = xmalloc(new_alloc * sizeof(sockets[0])); | ||
810 | for (i = old_alloc; i < new_alloc; i++) | 807 | for (i = old_alloc; i < new_alloc; i++) |
811 | sockets[i].type = AUTH_UNUSED; | 808 | sockets[i].type = AUTH_UNUSED; |
812 | sockets_alloc = new_alloc; | 809 | sockets_alloc = new_alloc; |