summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-05-13 17:28:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:02 -0500
commit91828b893d0fcae07e5678d03ef85811cf7c9c22 (patch)
tree38553415954d3a559fe7b2b0ffd1f9357d9522ce
parent77aa11f4dc78450640802cd944a2ee541f12080f (diff)
downloadsamba-91828b893d0fcae07e5678d03ef85811cf7c9c22.tar.gz
samba-91828b893d0fcae07e5678d03ef85811cf7c9c22.tar.bz2
samba-91828b893d0fcae07e5678d03ef85811cf7c9c22.zip
r15571: Fix Coverity bug #285
(This used to be commit 2cf503d7da08319f318217f6fe8f85c18bf0dffb)
-rw-r--r--source3/passdb/pdb_ldap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 24fcd7b39f..9386293793 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -4356,6 +4356,7 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv,
char *value;
int rc;
uint32 nextRid = 0;
+ const char *dn;
TALLOC_CTX *mem_ctx;
@@ -4419,9 +4420,12 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv,
talloc_asprintf(mem_ctx, "%d", nextRid));
talloc_autofree_ldapmod(mem_ctx, mods);
- rc = smbldap_modify(smbldap_state,
- smbldap_talloc_dn(mem_ctx, priv2ld(priv), entry),
- mods);
+ if ((dn = smbldap_talloc_dn(mem_ctx, priv2ld(priv), entry)) == NULL) {
+ status = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
+
+ rc = smbldap_modify(smbldap_state, dn, mods);
/* ACCESS_DENIED is used as a placeholder for "the modify failed,
* please retry" */