From 9310da1e2b483cbf9899ad1ebcdfd07f7c0eeac0 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Thu, 14 Oct 2010 22:36:07 +0200 Subject: s4:samdb_create_foreign_security_principal - proof error code of "samdb_msg_add_string" --- source4/dsdb/common/util.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index dbf7d3ec62..d0fc3b1b0e 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -2344,9 +2344,12 @@ NTSTATUS samdb_create_foreign_security_principal(struct ldb_context *sam_ctx, TA return NT_STATUS_NO_MEMORY; } - samdb_msg_add_string(sam_ctx, msg, msg, - "objectClass", - "foreignSecurityPrincipal"); + ret = samdb_msg_add_string(sam_ctx, msg, msg, + "objectClass", "foreignSecurityPrincipal"); + if (ret != LDB_SUCCESS) { + talloc_free(sidstr); + return NT_STATUS_NO_MEMORY; + } /* create the alias */ ret = ldb_add(sam_ctx, msg); -- cgit