From 68dc682499ea3fe27d909c946d7abd39062d6efd Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Thu, 30 Apr 2015 17:48:31 -0400 Subject: In apps, malloc or die No point in proceeding if you're out of memory. So change *all* OPENSSL_malloc calls in apps to use the new routine which prints a message and exits. Reviewed-by: Richard Levitte --- apps/s_socket.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'apps/s_socket.c') diff --git a/apps/s_socket.c b/apps/s_socket.c index 050426a0a4..caa5b61053 100644 --- a/apps/s_socket.c +++ b/apps/s_socket.c @@ -562,11 +562,7 @@ static int do_accept(int acc_sock, int *sock, char **host) *host = NULL; /* return(0); */ } else { - if ((*host = OPENSSL_malloc(strlen(h1->h_name) + 1)) == NULL) { - perror("OPENSSL_malloc"); - closesocket(ret); - return (0); - } + *host = app_malloc(strlen(h1->h_name) + 1, "copy hostname"); BUF_strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1); h2 = GetHostByName(*host); -- cgit v1.2.3