Call TALLOC_FREE() before we return otherwise we will never free sam_account
authorMichele Baldessari <michele@acksyn.org>
Mon, 10 Sep 2012 20:31:11 +0000 (13:31 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 10 Sep 2012 21:48:00 +0000 (14:48 -0700)
Signed-off-by: Jeremy Allison <jra@samba.org>
source3/utils/pdbedit.c

index 8a3551bf6bbf689ef49cd7c5d44a6f2747f95c01..908f0ba0afed40f345f4e2b248222376d9a06f71 100644 (file)
@@ -965,8 +965,8 @@ static int delete_machine_entry(const char *machinename)
        if (!pdb_getsampwnam(samaccount, name)) {
                fprintf (stderr,
                         "machine %s does not exist in the passdb\n", name);
-               return -1;
                TALLOC_FREE(samaccount);
+               return -1;
        }
 
        if (!NT_STATUS_IS_OK(pdb_delete_sam_account(samaccount))) {