Fix EBCDIC problem in conf_def.h
[openssl.git] / crypto / mem.c
index 46f00176ab077a7bc9b8b460fa16bfd8ff16a59b..9bdd5043a977a4ff6dbc9f9708653c83095e02e8 100644 (file)
@@ -136,23 +136,10 @@ void *CRYPTO_malloc(size_t num, const char *file, int line)
         ret = malloc(num);
     }
 #else
-    (void)file;
-    (void)line;
+    osslargused(file); osslargused(line);
     ret = malloc(num);
 #endif
 
-#ifndef OPENSSL_CPUID_OBJ
-    /*
-     * Create a dependency on the value of 'cleanse_ctr' so our memory
-     * sanitisation function can't be optimised out. NB: We only do this for
-     * >2Kb so the overhead doesn't bother us.
-     */
-    if (ret && (num > 2048)) {
-        extern unsigned char cleanse_ctr;
-        ((unsigned char *)ret)[0] = cleanse_ctr;
-    }
-#endif
-
     return ret;
 }
 
@@ -188,8 +175,7 @@ void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
         return ret;
     }
 #else
-    (void)file;
-    (void)line;
+    osslargused(file); osslargused(line);
 #endif
     return realloc(str, num);
 
@@ -215,10 +201,10 @@ void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,
     }
 
     ret = CRYPTO_malloc(num, file, line);
-
-    if (ret)
+    if (ret != NULL) {
         memcpy(ret, str, old_len);
-    CRYPTO_clear_free(str, old_len, file, line);
+        CRYPTO_clear_free(str, old_len, file, line);
+    }
     return ret;
 }