summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-06-19 16:44:15 -0700
committerJeremy Allison <jra@samba.org>2009-06-19 16:44:15 -0700
commitd9eb1d9764a27ae63c8d7f13d7f4148fd1833753 (patch)
treefe0341d59d902851a723bea3a20709dde54c6797
parentf262f80a1c7c9206c028abe9e2157b1dc955333b (diff)
downloadsamba-d9eb1d9764a27ae63c8d7f13d7f4148fd1833753.tar.gz
samba-d9eb1d9764a27ae63c8d7f13d7f4148fd1833753.tar.bz2
samba-d9eb1d9764a27ae63c8d7f13d7f4148fd1833753.zip
Fix coverity #900. Resource leak.
Jeremy.
-rw-r--r--source3/utils/smbpasswd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index c0b2cac18a..7957dd8a62 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -398,6 +398,10 @@ static int process_root(int local_flags)
if (remote_machine != NULL) {
old_passwd = get_pass("Old SMB password:",stdin_passwd_get);
+ if(!old_passwd) {
+ fprintf(stderr, "Unable to get old password.\n");
+ exit(1);
+ }
}
if (!(local_flags & LOCAL_SET_PASSWORD)) {
@@ -478,6 +482,7 @@ static int process_root(int local_flags)
}
done:
+ SAFE_FREE(old_passwd);
SAFE_FREE(new_passwd);
return result;
}