summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/ui/ui_lib.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-05-25 20:28:50 +0000
committertedu <tedu@openbsd.org>2014-05-25 20:28:50 +0000
commit66415b639e41b19badb8ea5e4b48aa9f294bf48b (patch)
treecf5efc4440a47d1b6f1105d83cc9b245c40061df /lib/libcrypto/ui/ui_lib.c
parentGet the vmspace pointer from the process, not the thread (diff)
downloadwireguard-openbsd-66415b639e41b19badb8ea5e4b48aa9f294bf48b.tar.xz
wireguard-openbsd-66415b639e41b19badb8ea5e4b48aa9f294bf48b.zip
calloc instead of malloc/memset. from Benjamin Baier
Diffstat (limited to 'lib/libcrypto/ui/ui_lib.c')
-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;
}