diff options
author | tedu <> | 2014-05-25 20:28:50 +0000 |
---|---|---|
committer | tedu <> | 2014-05-25 20:28:50 +0000 |
commit | 896ee758458e7d17dd2014f065480b5085e6be10 (patch) | |
tree | 7a0bda660a181d082657a078f67d9146fbd212c2 /src/lib/libcrypto/ui/ui_lib.c | |
parent | 339be6db68ff6f687a26e3c86aae9664fb3d0187 (diff) | |
download | openbsd-896ee758458e7d17dd2014f065480b5085e6be10.tar.gz openbsd-896ee758458e7d17dd2014f065480b5085e6be10.tar.bz2 openbsd-896ee758458e7d17dd2014f065480b5085e6be10.zip |
calloc instead of malloc/memset. from Benjamin Baier
Diffstat (limited to 'src/lib/libcrypto/ui/ui_lib.c')
-rw-r--r-- | src/lib/libcrypto/ui/ui_lib.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c index db0ef98b72..ff548f4bb8 100644 --- a/src/lib/libcrypto/ui/ui_lib.c +++ b/src/lib/libcrypto/ui/ui_lib.c | |||
@@ -584,12 +584,11 @@ UI_set_method(UI *ui, const UI_METHOD *meth) | |||
584 | UI_METHOD * | 584 | UI_METHOD * |
585 | UI_create_method(char *name) | 585 | UI_create_method(char *name) |
586 | { | 586 | { |
587 | UI_METHOD *ui_method = (UI_METHOD *)malloc(sizeof(UI_METHOD)); | 587 | UI_METHOD *ui_method = calloc(1, sizeof(UI_METHOD)); |
588 | 588 | ||
589 | if (ui_method) { | 589 | if (ui_method) |
590 | memset(ui_method, 0, sizeof(*ui_method)); | ||
591 | ui_method->name = BUF_strdup(name); | 590 | ui_method->name = BUF_strdup(name); |
592 | } | 591 | |
593 | return ui_method; | 592 | return ui_method; |
594 | } | 593 | } |
595 | 594 | ||