Unchecked malloc fixes
[openssl.git] / apps / s_client.c
index 8212c9fe4a52c03ba8e8100c6147bb94a6d6594c..8fa2b737aa7fe1d7ef2c087b080212c8591fc132 100644 (file)
@@ -560,6 +560,11 @@ static char *MS_CALLBACK ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
     PW_CB_DATA cb_tmp;
     int l;
 
+    if(!pass) {
+        BIO_printf(bio_err, "Malloc failure\n");
+        return NULL;
+    }
+
     cb_tmp.password = (char *)srp_arg->srppassin;
     cb_tmp.prompt_info = "SRP user";
     if ((l = password_callback(pass, PWD_STRLEN, 0, &cb_tmp)) < 0) {