Use safer sizeof variant in malloc
[openssl.git] / crypto / dso / dso_win32.c
index 144d8e63c33ad5bea8033fa762afaabbcf5b6a8b..bd96c5d2e3e62ea4779f560da9a96591869a66eb 100644 (file)
@@ -168,7 +168,7 @@ static int win32_load(DSO *dso)
         ERR_add_error_data(3, "filename(", filename, ")");
         goto err;
     }
-    p = OPENSSL_malloc(sizeof(HINSTANCE));
+    p = OPENSSL_malloc(sizeof(*p));
     if (p == NULL) {
         DSOerr(DSO_F_WIN32_LOAD, ERR_R_MALLOC_FAILURE);
         goto err;
@@ -304,7 +304,7 @@ static struct file_st *win32_splitter(DSO *dso, const char *filename,
         return (NULL);
     }
 
-    result = OPENSSL_malloc(sizeof(struct file_st));
+    result = OPENSSL_malloc(sizeof(*result));
     if (result == NULL) {
         DSOerr(DSO_F_WIN32_SPLITTER, ERR_R_MALLOC_FAILURE);
         return (NULL);