EVP_EncryptInit_ex() and EVP_DecryptInit_ex() had been defined in evp.h but
[openssl.git] / crypto / buffer / buffer.c
index fcc153013b7ca83bf50d4f382686a9be8e4034cc..b76ff3ad7acf24302a039e246455c34561fecfc7 100644 (file)
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "buffer.h"
+#include <openssl/buffer.h>
 
 BUF_MEM *BUF_MEM_new(void)
        {
        BUF_MEM *ret;
 
-       ret=(BUF_MEM *)Malloc(sizeof(BUF_MEM));
+       ret=OPENSSL_malloc(sizeof(BUF_MEM));
        if (ret == NULL)
                {
                BUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);
@@ -84,9 +84,9 @@ void BUF_MEM_free(BUF_MEM *a)
        if (a->data != NULL)
                {
                memset(a->data,0,(unsigned int)a->max);
-               Free(a->data);
+               OPENSSL_free(a->data);
                }
-       Free(a);
+       OPENSSL_free(a);
        }
 
 int BUF_MEM_grow(BUF_MEM *str, int len)
@@ -101,15 +101,15 @@ int BUF_MEM_grow(BUF_MEM *str, int len)
                }
        if (str->max >= len)
                {
-               memset(&(str->data[str->length]),0,len-str->length);
+               memset(&str->data[str->length],0,len-str->length);
                str->length=len;
                return(len);
                }
        n=(len+3)/3*4;
        if (str->data == NULL)
-               ret=(char *)Malloc(n);
+               ret=OPENSSL_malloc(n);
        else
-               ret=(char *)Realloc(str->data,n);
+               ret=OPENSSL_realloc(str->data,n);
        if (ret == NULL)
                {
                BUFerr(BUF_F_BUF_MEM_GROW,ERR_R_MALLOC_FAILURE);
@@ -132,7 +132,7 @@ char *BUF_strdup(const char *str)
        if (str == NULL) return(NULL);
 
        n=strlen(str);
-       ret=Malloc(n+1);
+       ret=OPENSSL_malloc(n+1);
        if (ret == NULL) 
                {
                BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);