diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-25 20:28:51 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-25 20:28:51 +0000 |
commit | 5e1459a8e0de5f557ec4791c59f2061b7becf9d1 (patch) | |
tree | 20bdf2790791966831cb26d2ef0d235a33e96910 /lib/libcrypto/ui | |
parent | 7999a18c62e4257df0056bc9103e6f2c6e5cbfca (diff) |
calloc instead of malloc/memset. from Benjamin Baier
Diffstat (limited to 'lib/libcrypto/ui')
-rw-r--r-- | lib/libcrypto/ui/ui_lib.c | 7 |
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; } |