struct dom_sid *sid, struct ldb_dn **ret_dn)
{
struct ldb_message *msg;
- struct ldb_dn *basedn;
+ struct ldb_dn *basedn = NULL;
char *sidstr;
int ret;
struct GUID *guid)
{
int ret;
- struct ldb_result *res;
+ struct ldb_result *res = NULL;
const char *attrs[2];
TALLOC_CTX *tmp_ctx = talloc_new(ldb);
talloc_free(tmp_ctx);
return ret;
}
+ /* satisfy clang */
+ if (res == NULL) {
+ talloc_free(tmp_ctx);
+ return LDB_ERR_OTHER;
+ }
if (res->count < 1) {
talloc_free(tmp_ctx);
return ldb_error(ldb, LDB_ERR_NO_SUCH_OBJECT, __func__);
struct ldb_dn *dn, struct dom_sid *sid)
{
int ret;
- struct ldb_result *res;
+ struct ldb_result *res = NULL;
const char *attrs[] = { "objectSid", NULL };
TALLOC_CTX *tmp_ctx = talloc_new(ldb);
struct dom_sid *s;
talloc_free(tmp_ctx);
return ret;
}
+ if (res == NULL) {
+ talloc_free(tmp_ctx);
+ return LDB_ERR_OTHER;
+ }
if (res->count < 1) {
talloc_free(tmp_ctx);
return ldb_error(ldb, LDB_ERR_NO_SUCH_OBJECT, __func__);
const char *attrs[] = { NULL };
int ret;
struct ldb_dn *dn;
- struct ldb_result *res;
+ struct ldb_result *res = NULL;
/* construct the magic WKGUID DN */
dn = ldb_dn_new_fmt(tmp_ctx, samdb, "<WKGUID=%s,%s>",
talloc_free(tmp_ctx);
return ret;
}
+ /* fix clang warning */
+ if (res == NULL){
+ talloc_free(tmp_ctx);
+ return LDB_ERR_OTHER;
+ }
(*wkguid_dn) = talloc_steal(mem_ctx, res->msgs[0]->dn);
talloc_free(tmp_ctx);
struct drsuapi_DsReplicaCursor2 **cursors, uint32_t *count)
{
static const char *attrs[] = { "replUpToDateVector", NULL };
- struct ldb_result *r;
+ struct ldb_result *r = NULL;
const struct ldb_val *ouv_value;
unsigned int i;
int ret;
if (ret != LDB_SUCCESS) {
return ret;
}
-
+ /* fix clang warning */
+ if (r == NULL) {
+ return LDB_ERR_OTHER;
+ }
ouv_value = ldb_msg_find_ldb_val(r->msgs[0], "replUpToDateVector");
if (ouv_value) {
enum ndr_err_code ndr_err;
int dsdb_load_udv_v1(struct ldb_context *samdb, struct ldb_dn *dn, TALLOC_CTX *mem_ctx,
struct drsuapi_DsReplicaCursor **cursors, uint32_t *count)
{
- struct drsuapi_DsReplicaCursor2 *v2;
+ struct drsuapi_DsReplicaCursor2 *v2 = NULL;
uint32_t i;
int ret;
struct ldb_dn *target_dn)
{
TALLOC_CTX *tmp_ctx;
- struct ldb_dn *source_nc;
- struct ldb_dn *target_nc;
+ struct ldb_dn *source_nc = NULL;
+ struct ldb_dn *target_nc = NULL;
int ret;
bool same_nc = true;
tmp_ctx = talloc_new(mem_ctx);
ret = dsdb_find_nc_root(ldb, tmp_ctx, source_dn, &source_nc);
+ /* fix clang warning */
+ if (source_nc == NULL) {
+ ret = LDB_ERR_OTHER;
+ }
if (ret != LDB_SUCCESS) {
DBG_ERR("Failed to find base DN for source %s\n",
ldb_dn_get_linearized(source_dn));
}
ret = dsdb_find_nc_root(ldb, tmp_ctx, target_dn, &target_nc);
+ /* fix clang warning */
+ if (target_nc == NULL) {
+ ret = LDB_ERR_OTHER;
+ }
if (ret != LDB_SUCCESS) {
DBG_ERR("Failed to find base DN for target %s\n",
ldb_dn_get_linearized(target_dn));