summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-14 22:43:33 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-15 08:45:14 +0200
commit9e69b22e70a6e119255e8e3d37964e6ae16ade09 (patch)
treed3ba1134fbc9004b077220477cea7dd14911368f /source4/dsdb
parent06ec5d0177ac3bcd2b12f6279b23bc0a02f93bf9 (diff)
downloadsamba-9e69b22e70a6e119255e8e3d37964e6ae16ade09.tar.gz
samba-9e69b22e70a6e119255e8e3d37964e6ae16ade09.tar.bz2
samba-9e69b22e70a6e119255e8e3d37964e6ae16ade09.zip
s4:dsdb/common/util.c - samdb_msg_add_* calls - proof for more OOM conditions
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/common/util.c6
1 files changed, 6 insertions, 0 deletions
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);
}