memset, memcpy, sizeof consistency fixes
[openssl.git] / crypto / LPdir_win.c
index 07e63fb4244ee8f5270911e520dfe331f6f9f9dd..4ff514f8856bac927b97afbe84020d33906a137c 100644 (file)
@@ -69,12 +69,12 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
             return 0;
         }
 
-        *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX));
+        *ctx = malloc(sizeof(**ctx));
         if (*ctx == NULL) {
             errno = ENOMEM;
             return 0;
         }
-        memset(*ctx, '\0', sizeof(LP_DIR_CTX));
+        memset(*ctx, 0, sizeof(**ctx));
 
         if (directory[dirlen - 1] != '*') {
             extdirbuf = (char *)malloc(dirlen + 3);