r19979: Fix memleak on pw and change talloc_destroy to TALLOC_FREE for mem_ctx
authorSimo Sorce <idra@samba.org>
Fri, 1 Dec 2006 15:04:53 +0000 (15:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:16:17 +0000 (12:16 -0500)
(This used to be commit defa0a352b32469984126ec5d47aab9ef8d6b61c)

source3/smbd/sesssetup.c

index 8c8173ef3741df2c8f2439c29b77c120d09c1b6e..ae6dd496639417542346cbc092d3094e1c4990a0 100644 (file)
@@ -335,7 +335,8 @@ static int reply_spnego_kerberos(connection_struct *conn,
                        SAFE_FREE(client);
                        data_blob_free(&ap_rep);
                        data_blob_free(&session_key);
-                       talloc_destroy(mem_ctx);
+                       TALLOC_FREE(mem_ctx);
+                       TALLOC_FREE(pw);
                        return ERROR_NT(nt_status_squash(ret));
                }
 
@@ -348,7 +349,8 @@ static int reply_spnego_kerberos(connection_struct *conn,
                        SAFE_FREE(client);
                        data_blob_free(&ap_rep);
                        data_blob_free(&session_key);
-                       talloc_destroy(mem_ctx);
+                       TALLOC_FREE(mem_ctx);
+                       TALLOC_FREE(pw);
                        return ERROR_NT(nt_status_squash(ret));
                }
 
@@ -372,6 +374,7 @@ static int reply_spnego_kerberos(connection_struct *conn,
                        SAFE_FREE(client);
                        data_blob_free(&ap_rep);
                        data_blob_free(&session_key);
+                       TALLOC_FREE(pw);
                        TALLOC_FREE( mem_ctx );
                        TALLOC_FREE( server_info );
                        return ERROR_NT(nt_status_squash(ret));
@@ -415,7 +418,8 @@ static int reply_spnego_kerberos(connection_struct *conn,
        data_blob_free(&ap_rep);
        data_blob_free(&ap_rep_wrapped);
        data_blob_free(&response);
-       talloc_destroy(mem_ctx);
+       TALLOC_FREE(mem_ctx);
+       TALLOC_FREE(pw);
 
        return -1; /* already replied */
 }