s3:rpc_server: Do not free the tdbname before we printed it
authorAndreas Schneider <asn@samba.org>
Wed, 8 May 2019 14:31:10 +0000 (16:31 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 8 May 2019 16:33:24 +0000 (16:33 +0000)
Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_server/eventlog/srv_eventlog_nt.c

index ce27dd530e16af3098b1d8f11bb6d47667cdacc8..5093125a6f672f73cfb5863bdddf0d3f6bc8b21f 100644 (file)
@@ -95,13 +95,13 @@ static bool elog_check_access( EVENTLOG_INFO *info, const struct security_token
                        tdbname,
                        SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL,
                        &sec_desc);
-       TALLOC_FREE( tdbname );
-
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(5,("elog_check_access: Unable to get NT ACL for %s: %s\n",
                        tdbname, nt_errstr(status)));
+               TALLOC_FREE(tdbname);
                return False;
        }
+       TALLOC_FREE(tdbname);
 
        ace = talloc_zero(sec_desc, struct security_ace);
        if (ace == NULL) {