summaryrefslogtreecommitdiffstats
path: root/source/utils/smbpasswd.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-11-23 12:04:35 +0100
committerJeremy Allison <jra@samba.org>2007-11-23 13:04:50 -0800
commit49949f0b85007c7c2b3c340c12f3d18909862135 (patch)
tree763657758dc5a39e21bd2799a776c5f796fb5ffd /source/utils/smbpasswd.c
parent9751cc222c70fd669a1cc1ad61ffb4e2e8444019 (diff)
downloadsamba-49949f0b85007c7c2b3c340c12f3d18909862135.tar.gz
samba-49949f0b85007c7c2b3c340c12f3d18909862135.tar.xz
samba-49949f0b85007c7c2b3c340c12f3d18909862135.zip
Make remote_password_change return malloced error strings
This fixes a segfault in smbpasswd -r
Diffstat (limited to 'source/utils/smbpasswd.c')
-rw-r--r--source/utils/smbpasswd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/utils/smbpasswd.c b/source/utils/smbpasswd.c
index b7fc65525ac..2154f5d15fb 100644
--- a/source/utils/smbpasswd.c
+++ b/source/utils/smbpasswd.c
@@ -243,9 +243,10 @@ static NTSTATUS password_change(const char *remote_mach, char *username,
return NT_STATUS_UNSUCCESSFUL;
}
ret = remote_password_change(remote_mach, username,
- old_passwd, new_pw, err_str, sizeof(err_str));
- if(*err_str)
+ old_passwd, new_pw, &err_str);
+ if (err_str != NULL)
fprintf(stderr, "%s", err_str);
+ SAFE_FREE(err_str);
return ret;
}