]> granicus.if.org Git - apache/commitdiff
Check if malloc succeeded
authorChristophe Jaillet <jailletc36@apache.org>
Sat, 1 Jun 2013 08:43:12 +0000 (08:43 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Sat, 1 Jun 2013 08:43:12 +0000 (08:43 +0000)
PR54344 [Bill Parker, wp02855 gmail com]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1488492 13f79535-47bb-0310-9956-ffa450edef68

support/ab.c

index 3ed1febb73b760fc9a83c110f84242c09b4969aa..5fb6bf81c204cd42cf6ba3a9d7242069599706c6 100644 (file)
@@ -627,6 +627,10 @@ static void ssl_proceed_handshake(struct connection *c)
                     pk_bits = 0;  /* Anon DH */
 
                 ssl_info = malloc(128);
+                if (ssl_info == NULL) {
+                    fprintf(stderr, "ab: Could not allocate ssl_info data buffer\n");
+                    return;
+                }
                 apr_snprintf(ssl_info, 128, "%s,%s,%d,%d",
                              SSL_get_version(c->ssl),
                              SSL_CIPHER_get_name(ci),