s3:auth: add comment to nulling out stolen sampass
authorMichael Adam <obnox@samba.org>
Tue, 12 Jan 2010 11:25:32 +0000 (12:25 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 12 Jan 2010 15:19:56 +0000 (16:19 +0100)
Adding this comment makes me think, I could also
have changed make_server_info_sam() talloc_move
instead of talloc_steal, but that would have
changed the signature... Well the comment is a
first step. :-)

Michael

source3/auth/auth_sam.c

index 834ca977dac581f0e1d7cfc9df7cc8462a5b6549..1dd8fc950ea60a86526fa24efaec542ee510e6af 100644 (file)
@@ -486,6 +486,10 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
        become_root();
        nt_status = make_server_info_sam(server_info, sampass);
        unbecome_root();
+       /*
+        * sampass has been stolen to server_info.
+        * So NULL it out to prevent segfaults.
+        */
        sampass = NULL;
 
        if (!NT_STATUS_IS_OK(nt_status)) {