From: Volker Lendecke Date: Sat, 13 Oct 2018 08:57:13 +0000 (+0200) Subject: netsamlogon_cache: Add some error checks X-Git-Tag: tdb-1.3.17~1306 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=030a3e506ec8dbe1808609b215f66b5e7e19951b;p=thirdparty%2Fsamba.git netsamlogon_cache: Add some error checks Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c index b65a1245000..d6889775d24 100644 --- a/source3/libsmb/samlogon_cache.c +++ b/source3/libsmb/samlogon_cache.c @@ -179,6 +179,9 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3) if (full_name != NULL) { info3->base.full_name.string = talloc_strdup(info3, full_name); + if (info3->base.full_name.string == NULL) { + goto fail; + } } } @@ -187,6 +190,9 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3) if (!info3->base.account_name.string) { info3->base.account_name.string = talloc_strdup(info3, username); + if (info3->base.account_name.string == NULL) { + goto fail; + } } r.timestamp = time(NULL);