make EVP_dss() work for DSA signing
[openssl.git] / crypto / mem.c
index 43d48ab425707d2d08c289e47f597fc32e9bb955..46a4e6c6dd8a210da5003003153e2f3045c57c08 100644 (file)
@@ -125,6 +125,7 @@ static long (*get_debug_options_func)(void) = NULL;
 int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t),
        void (*f)(void *))
        {
+       OPENSSL_init();
        if (!allow_customize)
                return 0;
        if ((m == 0) || (r == 0) || (f == 0))
@@ -184,6 +185,7 @@ int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int),
                                   void (*so)(long),
                                   long (*go)(void))
        {
+       OPENSSL_init();
        if (!allow_customize_debug)
                return 0;
        malloc_debug_func=m;
@@ -322,6 +324,13 @@ void *CRYPTO_malloc(int num, const char *file, int line)
 
        return ret;
        }
+char *CRYPTO_strdup(const char *str, const char *file, int line)
+       {
+       char *ret = CRYPTO_malloc(strlen(str)+1, file, line);
+
+       strcpy(ret, str);
+       return ret;
+       }
 
 void *CRYPTO_realloc(void *str, int num, const char *file, int line)
        {