Fix a memleak in calculate_next_machine_pwd_change (This used to be commit 5314f06dcd...
authorVolker Lendecke <vl@sernet.de>
Sat, 23 Aug 2008 11:12:05 +0000 (13:12 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 26 Nov 2008 09:13:34 +0000 (10:13 +0100)
(cherry picked from commit fa20fa5d243ee640f5d564525358c1f5ba2df3a7)

source/winbindd/winbindd_dual.c

index e4e6544dea4da63884b584f87c3458861d53232e..403a9bc8d862b5c9738ee46a5dbba71cfb498465 100644 (file)
@@ -883,14 +883,19 @@ static bool calculate_next_machine_pwd_change(const char *domain,
        time_t pass_last_set_time;
        time_t timeout;
        time_t next_change;
+       char *pw;
 
-       if (!secrets_fetch_machine_password(domain,
+       pw = secrets_fetch_machine_password(domain,
                                            &pass_last_set_time,
-                                           NULL)) {
+                                           NULL);
+
+       if (pw == NULL) {
                DEBUG(0,("cannot fetch own machine password ????"));
                return false;
        }
 
+       SAFE_FREE(pw);
+
        timeout = get_machine_password_timeout();
        if (timeout == 0) {
                DEBUG(10,("machine password never expires\n"));