netsamlogon_cache: Add some error checks
authorVolker Lendecke <vl@samba.org>
Sat, 13 Oct 2018 08:57:13 +0000 (10:57 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 17 Oct 2018 17:22:19 +0000 (19:22 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/samlogon_cache.c

index b65a1245000c8d65a35deb9c615b9e1aa02a1734..d6889775d24402575d4ddb60999dfe3644286cc1 100644 (file)
@@ -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);