s4:tls: avoid using talloc_reference() in tls_init_client()
authorStefan Metzmacher <metze@samba.org>
Thu, 30 Jul 2009 06:42:42 +0000 (08:42 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 31 Jul 2009 12:42:04 +0000 (14:42 +0200)
metze

source4/lib/tls/tls.c

index b87bd2c307d94e780144b88ad777a4217258d6a5..d4e8680a6bf34cf7acab952a92e9fdc18d1c53ad 100644 (file)
@@ -554,13 +554,9 @@ struct socket_context *tls_init_client(struct socket_context *socket_ctx,
        if (tls == NULL) return NULL;
 
        tls->socket          = socket_ctx;
+       talloc_steal(tls, socket_ctx);
        tls->fde             = fde;
-       if (talloc_reference(tls, fde) == NULL) {
-               return NULL;
-       }
-       if (talloc_reference(tls, socket_ctx) == NULL) {
-               return NULL;
-       }
+
        new_sock->private_data    = tls;
 
        gnutls_global_init();