summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2010-06-28 11:06:22 +0200
committerAndreas Schneider <asn@samba.org>2010-06-28 12:56:13 +0200
commitac5600fc7e996bdde23666bc96a834044556c85f (patch)
treedf42abe1705c547ede9788241a9cb6e22e51e9c3 /source3
parent6d89116afe89e29d4e9bd0d69f7032a2b47f4c07 (diff)
downloadsamba-ac5600fc7e996bdde23666bc96a834044556c85f.tar.gz
samba-ac5600fc7e996bdde23666bc96a834044556c85f.tar.bz2
samba-ac5600fc7e996bdde23666bc96a834044556c85f.zip
s3-passdb: Make sure dn is initialized and don't free it.
dn is just a pointer to a memory which hasn't been duplicated. Found by clang-analyzer.
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/pdb_ads.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index c5d8cc2c02..096063b0a0 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -1190,7 +1190,7 @@ static NTSTATUS pdb_ads_delete_alias(struct pdb_methods *m,
m->private_data, struct pdb_ads_state);
struct tldap_context *ld;
struct tldap_message **alias;
- char *sidstr, *dn;
+ char *sidstr, *dn = NULL;
int rc;
ld = pdb_ads_ld(state);
@@ -1213,7 +1213,6 @@ static NTSTATUS pdb_ads_delete_alias(struct pdb_methods *m,
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search failed: %s\n",
tldap_errstr(talloc_tos(), state->ld, rc)));
- TALLOC_FREE(dn);
return NT_STATUS_LDAP(rc);
}
if (talloc_array_length(alias) != 1) {
@@ -1231,7 +1230,6 @@ static NTSTATUS pdb_ads_delete_alias(struct pdb_methods *m,
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_delete failed: %s\n",
tldap_errstr(talloc_tos(), state->ld, rc)));
- TALLOC_FREE(dn);
return NT_STATUS_LDAP(rc);
}