2 * Copyright (C) 2001,2002 Nikos Mavroyanopoulos
4 * This file is part of GNUTLS.
6 * The GNUTLS library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <gnutls_int.h>
23 #include <gnutls_errors.h>
24 #include <gnutls_num.h>
26 void* (*gnutls_secure_malloc
)(size_t) = malloc
;
27 void* (*gnutls_malloc
)(size_t) = malloc
;
28 void (*gnutls_free
)(void*) = free
;
30 int _gnutls_is_secure_mem_null( const void* ign
) { return 0; }
32 int (*_gnutls_is_secure_memory
)(const void*) = _gnutls_is_secure_mem_null
;
33 void* (*gnutls_realloc
)(void*, size_t) = realloc
;
36 void *gnutls_calloc(size_t nmemb
, size_t size
)
39 ret
= gnutls_malloc(size
);
48 svoid
*gnutls_secure_calloc(size_t nmemb
, size_t size
)
51 ret
= gnutls_secure_malloc(size
);
60 char *gnutls_strdup(const char *s
)
65 ret
= gnutls_malloc(size
+ 1); /* hold null */
69 strcpy(ret
, s
); /* Flawfinder: ignore */