00001 /* 00002 * Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation 00003 * 00004 * Author: Nikos Mavrogiannopoulos 00005 * 00006 * This file is part of GNUTLS. 00007 * 00008 * The GNUTLS library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation; either version 2.1 of 00011 * the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, but 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00021 * USA 00022 * 00023 */ 00024 00025 #include <gnutls_int.h> 00026 #include <gnutls_errors.h> 00027 #include <gnutls_num.h> 00028 00029 MHD_gnutls_alloc_function MHD_gnutls_secure_malloc = malloc; 00030 MHD_gnutls_alloc_function MHD_gnutls_malloc = malloc; 00031 MHD_gnutls_free_function MHD_gnutls_free = free; 00032 MHD_gnutls_realloc_function MHD_gnutls_realloc = realloc; 00033 00034 void *(*MHD_gnutls_calloc) (size_t, size_t) = calloc; 00035 00036 int 00037 MHD__gnutls_is_secure_mem_null (const void *ign) 00038 { 00039 return 0; 00040 } 00041 00042 int (*MHD__gnutls_is_secure_memory) (const void *) = 00043 MHD__gnutls_is_secure_mem_null; 00044 00045 00046 00047 /* This realloc will free ptr in case realloc 00048 * fails. 00049 */ 00050 void * 00051 MHD_gtls_realloc_fast (void *ptr, size_t size) 00052 { 00053 void *ret; 00054 00055 if (size == 0) 00056 return ptr; 00057 00058 ret = MHD_gnutls_realloc (ptr, size); 00059 if (ret == NULL) 00060 { 00061 MHD_gnutls_free (ptr); 00062 } 00063 00064 return ret; 00065 }