Use safer sizeof variant in malloc
[oweals/openssl.git] / crypto / dso / dso_lib.c
index 99701d15d4362befc7a22ae56bd046f251ab4fc1..a0e711c76b0fd03579386f4e3829e7bc1f72b758 100644 (file)
@@ -104,7 +104,7 @@ DSO *DSO_new_method(DSO_METHOD *meth)
          */
         default_DSO_meth = DSO_METHOD_openssl();
     }
-    ret = OPENSSL_malloc(sizeof(DSO));
+    ret = OPENSSL_malloc(sizeof(*ret));
     if (ret == NULL) {
         DSOerr(DSO_F_DSO_NEW_METHOD, ERR_R_MALLOC_FAILURE);
         return (NULL);