From d2c2635a280b1bfbbcd52fa96bbeff3f60672c45 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 23 Nov 2007 12:04:35 +0100 Subject: Make remote_password_change return malloced error strings This fixes a segfault in smbpasswd -r (This used to be commit 49949f0b85007c7c2b3c340c12f3d18909862135) --- source3/utils/smbpasswd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index b7fc65525a..2154f5d15f 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/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; } -- cgit