summaryrefslogtreecommitdiffstats
path: root/apps/cms.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-04-30 17:48:31 -0400
committerRich Salz <rsalz@openssl.org>2015-04-30 17:48:31 -0400
commit68dc682499ea3fe27d909c946d7abd39062d6efd (patch)
tree3478a6fb3699bdfa08d5871848696882ee1c24db /apps/cms.c
parent222561fe8ef510f336417a666f69f81ddc9b8fe4 (diff)
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 <levitte@openssl.org>
Diffstat (limited to 'apps/cms.c')
-rw-r--r--apps/cms.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/apps/cms.c b/apps/cms.c
index 16dbc0c296..907b108fc5 100644
--- a/apps/cms.c
+++ b/apps/cms.c
@@ -570,11 +570,7 @@ int cms_main(int argc, char **argv)
}
if (key_param == NULL || key_param->idx != keyidx) {
cms_key_param *nparam;
- nparam = OPENSSL_malloc(sizeof(cms_key_param));
- if (!nparam) {
- BIO_printf(bio_err, "Out of memory\n");
- goto end;
- }
+ nparam = app_malloc(sizeof *nparam, "key param buffer");
nparam->idx = keyidx;
if ((nparam->param = sk_OPENSSL_STRING_new_null()) == NULL)
goto end;