aboutsummaryrefslogtreecommitdiff
path: root/crypto/bio/b_sock.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-04-28 16:34:52 -0400
committerRich Salz <rsalz@openssl.org>2015-04-28 16:34:52 -0400
commit2d29e2df0c9040e139d68c8659ee0342a6ac3dd1 (patch)
tree1c204074c02b3e356e60b51abe82e4552983bc80 /crypto/bio/b_sock.c
parentb196e7d936fb377d9c5b305748ac25ff0e53ef6d (diff)
downloadopenssl-2d29e2df0c9040e139d68c8659ee0342a6ac3dd1.zip
openssl-2d29e2df0c9040e139d68c8659ee0342a6ac3dd1.tar.gz
openssl-2d29e2df0c9040e139d68c8659ee0342a6ac3dd1.tar.bz2
realloc of NULL is like malloc
ANSI C, and OpenSSL's malloc wrapper do this, also. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/bio/b_sock.c')
-rw-r--r--crypto/bio/b_sock.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index ca485d9..a4fded5 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -673,12 +673,9 @@ int BIO_accept(int sock, char **addr)
break;
nl = strlen(h) + strlen(s) + 2;
p = *addr;
- if (p) {
+ if (p)
*p = '\0';
- p = OPENSSL_realloc(p, nl);
- } else {
- p = OPENSSL_malloc(nl);
- }
+ p = OPENSSL_realloc(p, nl);
if (p == NULL) {
BIOerr(BIO_F_BIO_ACCEPT, ERR_R_MALLOC_FAILURE);
goto end;