diff options
| author | tedu <> | 2014-05-25 20:28:50 +0000 |
|---|---|---|
| committer | tedu <> | 2014-05-25 20:28:50 +0000 |
| commit | 7ac48fead6b52013328f67c97481309ffa1e7b59 (patch) | |
| tree | 7a0bda660a181d082657a078f67d9146fbd212c2 /src/lib/libcrypto/store/str_meth.c | |
| parent | 8940e52b42d901dc8efea2d945fccb8954f11458 (diff) | |
| download | openbsd-7ac48fead6b52013328f67c97481309ffa1e7b59.tar.gz openbsd-7ac48fead6b52013328f67c97481309ffa1e7b59.tar.bz2 openbsd-7ac48fead6b52013328f67c97481309ffa1e7b59.zip | |
calloc instead of malloc/memset. from Benjamin Baier
Diffstat (limited to 'src/lib/libcrypto/store/str_meth.c')
| -rw-r--r-- | src/lib/libcrypto/store/str_meth.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/store/str_meth.c b/src/lib/libcrypto/store/str_meth.c index 8944824618..0401aaa129 100644 --- a/src/lib/libcrypto/store/str_meth.c +++ b/src/lib/libcrypto/store/str_meth.c | |||
| @@ -62,13 +62,11 @@ | |||
| 62 | 62 | ||
| 63 | STORE_METHOD *STORE_create_method(char *name) | 63 | STORE_METHOD *STORE_create_method(char *name) |
| 64 | { | 64 | { |
| 65 | STORE_METHOD *store_method = (STORE_METHOD *)malloc(sizeof(STORE_METHOD)); | 65 | STORE_METHOD *store_method = calloc(1, sizeof(STORE_METHOD)); |
| 66 | 66 | ||
| 67 | if (store_method) | 67 | if (store_method) |
| 68 | { | ||
| 69 | memset(store_method, 0, sizeof(*store_method)); | ||
| 70 | store_method->name = BUF_strdup(name); | 68 | store_method->name = BUF_strdup(name); |
| 71 | } | 69 | |
| 72 | return store_method; | 70 | return store_method; |
| 73 | } | 71 | } |
| 74 | 72 | ||
