summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ui/ui_lib.c
diff options
context:
space:
mode:
authortedu <>2014-05-25 20:28:50 +0000
committertedu <>2014-05-25 20:28:50 +0000
commit896ee758458e7d17dd2014f065480b5085e6be10 (patch)
tree7a0bda660a181d082657a078f67d9146fbd212c2 /src/lib/libcrypto/ui/ui_lib.c
parent339be6db68ff6f687a26e3c86aae9664fb3d0187 (diff)
downloadopenbsd-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.c7
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)
584UI_METHOD * 584UI_METHOD *
585UI_create_method(char *name) 585UI_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