]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
eliminated some memory leaks and other fixes.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 1 Dec 2003 08:50:32 +0000 (08:50 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 1 Dec 2003 08:50:32 +0000 (08:50 +0000)
configure.in
lib/gnutls_hash_int.c
lib/gnutls_random.c
lib/x509/dn.c
src/common.c

index f6e6ee8218071f71a81245da15d992e3e9dfa426..42c267683ee1cd56cb26d3d104d4f0a82105e76e 100644 (file)
@@ -17,7 +17,7 @@ GNUTLS_VERSION=$GNUTLS_MAJOR_VERSION.$GNUTLS_MINOR_VERSION.$GNUTLS_MICRO_VERSION
 
 AC_DEFINE_UNQUOTED(GNUTLS_VERSION, "$GNUTLS_VERSION", [version of gnutls])
 
-GNUTLS_GCRYPT_VERSION=1.1.44
+GNUTLS_GCRYPT_VERSION=1.1.90
 GNUTLS_LIBTASN1_VERSION=0.2.5
 AC_DEFINE_UNQUOTED(GNUTLS_GCRYPT_VERSION, "$GNUTLS_GCRYPT_VERSION", [version of gcrypt])
 AC_DEFINE_UNQUOTED(GNUTLS_LIBTASN1_VERSION, "$GNUTLS_LIBTASN1_VERSION", [version of libtasn1])
@@ -262,17 +262,6 @@ AM_PATH_LIBGCRYPT($GNUTLS_GCRYPT_VERSION,,
 dnl Can't disable - gnutls depends on gcrypt
 AC_DEFINE(USE_GCRYPT, 1, [use gcrypt])
 
-# Since libgcrypt 1.1.90 we have a new function to create nonces etc.
-# it is useful to use this one instead of the the standard random
-# functions.  As a temporary solution we check for that function and
-# don't require an unrelease libgcrypt.  This should be changed after
-# libgcrypt 1.2 has been released.
-save_LIBS="$LIBS"
-LIBS="$LIBS $LIBGCRYPT_LIBS"
-AC_CHECK_FUNCS(gcry_create_nonce)
-LIBS="$save_LIBS"
-
-
 AC_MSG_CHECKING([whether to disable SRP authentication support])
 AC_ARG_ENABLE( srp-authentication, [  --disable-srp-authentication     Disable the SRP authentication support],
  ac_enable_srp=no
index 1b074e2b6b8fabb4b7fd915ec0d70eb7b1e37ee4..1746f963dc542e0ec44bd5ba8fa2d0500cccded7 100644 (file)
@@ -31,7 +31,7 @@
 GNUTLS_HASH_HANDLE _gnutls_hash_init(gnutls_mac_algorithm algorithm)
 {
        GNUTLS_MAC_HANDLE ret = NULL;
-       gcry_error_t result;
+       gcry_error_t result = 0;
 
        ret = gnutls_malloc(sizeof(GNUTLS_MAC_HANDLE_INT));
        if (ret == NULL) {
@@ -54,7 +54,7 @@ GNUTLS_HASH_HANDLE _gnutls_hash_init(gnutls_mac_algorithm algorithm)
        default:
                gnutls_assert();
                gnutls_free( ret);
-               ret = GNUTLS_HASH_FAILED; break;
+               ret = GNUTLS_HASH_FAILED;
        }
 
        if (result) {
@@ -141,7 +141,7 @@ GNUTLS_MAC_HANDLE _gnutls_hmac_init(gnutls_mac_algorithm algorithm,
                                    const void *key, int keylen)
 {
        GNUTLS_MAC_HANDLE ret;
-       gcry_error_t result;
+       gcry_error_t result = 0;
 
        ret = gnutls_malloc(sizeof(GNUTLS_MAC_HANDLE_INT));
        if (ret == NULL)
index 2937342bb441d91766412c0efa06d3685a4a653b..849ac3cb91ebf69566db1536cd3c62538add44e1 100644 (file)
  */
 int _gnutls_get_random(opaque * res, int bytes, int level)
 {
-#ifdef HAVE_GCRY_CREATE_NONCE
     if (level == GNUTLS_WEAK_RANDOM) {
       gcry_create_nonce( res, bytes);
       return 0;
     }
-#endif
 
     gcry_randomize( res, bytes, level);
 
index 857374a57ebca6d8df75fafd27eb31e0826cdcbc..755f72ec558637b803541972c9aefdd15fbd71ed 100644 (file)
@@ -283,6 +283,7 @@ int _gnutls_x509_parse_dn(ASN1_TYPE asn1_struct,
                                        goto cleanup;
                                }
                                STR_APPEND(str_escape(string, escaped, sizeof_escaped));
+                               gnutls_free(string); string = NULL;
                        } else {
                                char *res;
 
@@ -320,6 +321,7 @@ int _gnutls_x509_parse_dn(ASN1_TYPE asn1_struct,
 
       cleanup:
        gnutls_free( value2);
+       gnutls_free( string);
        gnutls_free( escaped);
        _gnutls_string_clear(&out_str);
        return result;
index c62fd312f9fe20b0cefed72b12283e9bd6a5b7cf..870ae5aba8ad9c3def27bc19a33658e8bf887566 100644 (file)
@@ -323,6 +323,8 @@ void print_openpgp_info(gnutls_session session, const char* hostname)
                        }
 
                }
+               
+               gnutls_openpgp_key_deinit( crt);
 
        }
 }