diff options
Diffstat (limited to 'src/lib/libc/net')
-rw-r--r-- | src/lib/libc/net/getprotoent.c | 4 | ||||
-rw-r--r-- | src/lib/libc/net/getservent.c | 4 | ||||
-rw-r--r-- | src/lib/libc/net/rcmdsh.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libc/net/getprotoent.c b/src/lib/libc/net/getprotoent.c index 7c6ab68166..f0705e0765 100644 --- a/src/lib/libc/net/getprotoent.c +++ b/src/lib/libc/net/getprotoent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getprotoent.c,v 1.9 2006/01/17 15:41:52 millert Exp $ */ | 1 | /* $OpenBSD: getprotoent.c,v 1.10 2007/09/02 15:19:17 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1983, 1993 | 3 | * Copyright (c) 1983, 1993 |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. |
@@ -102,7 +102,7 @@ again: | |||
102 | pe->p_proto = l; | 102 | pe->p_proto = l; |
103 | if (pd->aliases == NULL) { | 103 | if (pd->aliases == NULL) { |
104 | pd->maxaliases = 5; | 104 | pd->maxaliases = 5; |
105 | pd->aliases = malloc(pd->maxaliases * sizeof(char *)); | 105 | pd->aliases = calloc(pd->maxaliases, sizeof(char *)); |
106 | if (pd->aliases == NULL) { | 106 | if (pd->aliases == NULL) { |
107 | serrno = errno; | 107 | serrno = errno; |
108 | endprotoent_r(pd); | 108 | endprotoent_r(pd); |
diff --git a/src/lib/libc/net/getservent.c b/src/lib/libc/net/getservent.c index ab916b8e80..c81a4cf3e2 100644 --- a/src/lib/libc/net/getservent.c +++ b/src/lib/libc/net/getservent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getservent.c,v 1.11 2006/01/17 15:41:52 millert Exp $ */ | 1 | /* $OpenBSD: getservent.c,v 1.12 2007/09/02 15:19:17 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1983, 1993 | 3 | * Copyright (c) 1983, 1993 |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. |
@@ -104,7 +104,7 @@ again: | |||
104 | se->s_proto = cp; | 104 | se->s_proto = cp; |
105 | if (sd->aliases == NULL) { | 105 | if (sd->aliases == NULL) { |
106 | sd->maxaliases = 10; | 106 | sd->maxaliases = 10; |
107 | sd->aliases = malloc(sd->maxaliases * sizeof(char *)); | 107 | sd->aliases = calloc(sd->maxaliases, sizeof(char *)); |
108 | if (sd->aliases == NULL) { | 108 | if (sd->aliases == NULL) { |
109 | serrno = errno; | 109 | serrno = errno; |
110 | endservent_r(sd); | 110 | endservent_r(sd); |
diff --git a/src/lib/libc/net/rcmdsh.c b/src/lib/libc/net/rcmdsh.c index 34a228d1e9..a472162711 100644 --- a/src/lib/libc/net/rcmdsh.c +++ b/src/lib/libc/net/rcmdsh.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rcmdsh.c,v 1.11 2005/08/06 20:30:03 espie Exp $ */ | 1 | /* $OpenBSD: rcmdsh.c,v 1.12 2007/09/02 15:19:17 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2001, MagniComp | 4 | * Copyright (c) 2001, MagniComp |
@@ -151,7 +151,7 @@ rcmdsh(char **ahost, int rport, const char *locuser, const char *remuser, | |||
151 | for (n = 7; (p = strchr(++p, ' ')) != NULL; n++) | 151 | for (n = 7; (p = strchr(++p, ' ')) != NULL; n++) |
152 | continue; | 152 | continue; |
153 | rshprog = strdup(rshprog); | 153 | rshprog = strdup(rshprog); |
154 | ap = argv = malloc(sizeof(char *) * n); | 154 | ap = argv = calloc(sizeof(char *), n); |
155 | if (rshprog == NULL || argv == NULL) { | 155 | if (rshprog == NULL || argv == NULL) { |
156 | perror("rcmdsh"); | 156 | perror("rcmdsh"); |
157 | _exit(255); | 157 | _exit(255); |