Add and use OPENSSL_zalloc
[openssl.git] / crypto / store / str_meth.c
index 74878197f9d24e07d15e26fa80a4a43e3c9f1526..c030198841ccfd765a3fc99c9520fbf98b446fe0 100644 (file)
 
 STORE_METHOD *STORE_create_method(char *name)
 {
-    STORE_METHOD *store_method = OPENSSL_malloc(sizeof(*store_method));
+    STORE_METHOD *store_method = OPENSSL_zalloc(sizeof(*store_method));
 
-    if (store_method) {
-        memset(store_method, 0, sizeof(*store_method));
+    if (store_method)
         store_method->name = BUF_strdup(name);
-    }
     return store_method;
 }