diff options
author | Jones Syue <jonessyue@qnap.com> | 2019-11-01 15:50:29 +0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-11-04 22:48:50 +0000 |
commit | a58c93318d592d931d232a1a25e37abdd27a825d (patch) | |
tree | 70bc79acc77b43f201cd197d1993b357b96fe1f4 /source3 | |
parent | 831796b2d7c1ee13d17238b5b4a2c3d56ab6eaaf (diff) | |
download | samba-a58c93318d592d931d232a1a25e37abdd27a825d.tar.gz |
s3:libads: Fix mem leak in ads_create_machine_acct
Use 'goto done' instead of 'return' to fix machine_escaped leak.
Signed-off-by: Jones Syue <jonessyue@qnap.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Nov 4 22:48:50 UTC 2019 on sn-devel-184
Diffstat (limited to 'source3')
-rwxr-xr-x[-rw-r--r--] | source3/libads/ldap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 90d402abb4e..a630c5a0345 100644..100755 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -2370,7 +2370,8 @@ ADS_STATUS ads_create_machine_acct(ADS_STRUCT *ads, /* Make sure to NULL terminate the array */ spn_array = talloc_realloc(ctx, spn_array, const char *, num_spns + 1); if (spn_array == NULL) { - return ADS_ERROR_LDAP(LDAP_NO_MEMORY); + ret = ADS_ERROR(LDAP_NO_MEMORY); + goto done; } spn_array[num_spns] = NULL; |