From 9e69b22e70a6e119255e8e3d37964e6ae16ade09 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Thu, 14 Oct 2010 22:43:33 +0200 Subject: s4:dsdb/common/util.c - samdb_msg_add_* calls - proof for more OOM conditions --- source4/dsdb/common/util.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/dsdb') diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 3dd5f78964..dbf7d3ec62 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -926,6 +926,9 @@ int samdb_msg_add_int(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct l const char *attr_name, int v) { const char *s = talloc_asprintf(mem_ctx, "%d", v); + if (s == NULL) { + return ldb_oom(sam_ldb); + } return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, s); } @@ -945,6 +948,9 @@ int samdb_msg_add_int64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct const char *attr_name, int64_t v) { const char *s = talloc_asprintf(mem_ctx, "%lld", (long long)v); + if (s == NULL) { + return ldb_oom(sam_ldb); + } return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, s); } -- cgit