]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix a memleak in calculate_next_machine_pwd_change
authorVolker Lendecke <vl@sernet.de>
Sat, 23 Aug 2008 11:12:05 +0000 (13:12 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 23 Aug 2008 11:19:35 +0000 (13:19 +0200)
source/winbindd/winbindd_dual.c

index aa6da545d3d8f45900a8127134bab8f4d20ec0bc..4d879c6fc4184cf80e43aea297611d6d43861cd1 100644 (file)
@@ -852,14 +852,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"));