diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-12-06 17:14:22 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-12-06 17:14:22 +0000 |
commit | b0d4b6150fac1f17c61058a19e86ccedc2ff87c2 (patch) | |
tree | 4ec51caa2caf3ac4b876240d7e45c80863a483fe /lib/gnutls_db.c | |
parent | 84db053194b3e76290e75e6c4a268b2143774687 (diff) | |
download | gnutls-b0d4b6150fac1f17c61058a19e86ccedc2ff87c2.tar.gz |
Added the new functions gnutls_get_malloc_function(), gnutls_get_free_function(). Also changed the way callback functions must allocate data. They now need to use these functions, instead of just calling malloc().
Diffstat (limited to 'lib/gnutls_db.c')
-rw-r--r-- | lib/gnutls_db.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/gnutls_db.c b/lib/gnutls_db.c index 1c2ab4fdce..601f6bad2f 100644 --- a/lib/gnutls_db.c +++ b/lib/gnutls_db.c @@ -39,6 +39,9 @@ * sessions database. This function must return a gnutls_datum containing the * data on success, or a gnutls_datum containing null and 0 on failure. * + * The datum's data must be allocated using the function returned by + * gnutls_get_malloc_function(). + * * The first argument to store_function() will be null unless gnutls_db_set_ptr() * has been called. * @@ -222,10 +225,8 @@ int ret; gnutls_assert(); return ret; } - - /* Note: Data is not allocated with gnutls_malloc - */ - free(data.data); + + gnutls_free(data.data); return 0; } @@ -306,7 +307,6 @@ int ret = 0; if (session->internals.db_remove_func!=NULL) ret = session->internals.db_remove_func( session->internals.db_ptr, session_id); - return (ret == 0 ? ret : GNUTLS_E_DB_ERROR); } |