]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python:netcmd: Explicitly delete samdb variables
authorJo Sutton <josutton@catalyst.net.nz>
Thu, 18 Jul 2024 22:21:56 +0000 (10:21 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Sun, 4 Aug 2024 00:32:39 +0000 (00:32 +0000)
This makes our intent clear, and avoids accidental attempts to use these
objects after they have been ‘disconnect()’ed.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/netcmd/domain/backup.py

index b27105116dccf2a68119b87f455d81e34574bef7..b1b57c04a7fb74a5f24fad7bf91cec4790788419 100644 (file)
@@ -1182,7 +1182,7 @@ class cmd_domain_backup_offline(samba.netcmd.Command):
         # not use this any more as the data has all been copied under
         # the transaction
         samdb.disconnect()
-        samdb = None
+        del samdb
 
         # Open the new backed up samdb, flag it as backed up, and write
         # the next SID so the restore tool can add objects. We use
@@ -1200,7 +1200,7 @@ class cmd_domain_backup_offline(samba.netcmd.Command):
 
         # Close the backed up samdb
         samdb.disconnect()
-        samdb = None
+        del samdb
 
         # Now handle all the LDB and TDB files that are not linked to
         # anything else.  Use transactions for LDBs.