mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
s4:dsdb/common/util.c - samdb_msg_add_* calls - proof for more OOM conditions
This commit is contained in:
parent
06ec5d0177
commit
9e69b22e70
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user