summaryrefslogtreecommitdiff
path: root/lib/libcrypto/ui
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-05-25 20:28:51 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-05-25 20:28:51 +0000
commit5e1459a8e0de5f557ec4791c59f2061b7becf9d1 (patch)
tree20bdf2790791966831cb26d2ef0d235a33e96910 /lib/libcrypto/ui
parent7999a18c62e4257df0056bc9103e6f2c6e5cbfca (diff)
calloc instead of malloc/memset. from Benjamin Baier
Diffstat (limited to 'lib/libcrypto/ui')
-rw-r--r--lib/libcrypto/ui/ui_lib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libcrypto/ui/ui_lib.c b/lib/libcrypto/ui/ui_lib.c
index db0ef98b721..ff548f4bb8d 100644
--- a/lib/libcrypto/ui/ui_lib.c
+++ b/lib/libcrypto/ui/ui_lib.c
@@ -584,12 +584,11 @@ UI_set_method(UI *ui, const UI_METHOD *meth)
UI_METHOD *
UI_create_method(char *name)
{
- UI_METHOD *ui_method = (UI_METHOD *)malloc(sizeof(UI_METHOD));
+ UI_METHOD *ui_method = calloc(1, sizeof(UI_METHOD));
- if (ui_method) {
- memset(ui_method, 0, sizeof(*ui_method));
+ if (ui_method)
ui_method->name = BUF_strdup(name);
- }
+
return ui_method;
}