return WERR_FOOBAR;
}
- if (res->count == 0 || res->msgs[0]->num_elements == 0)
+ if (res->count == 0 || res->msgs[0]->num_elements == 0) {
+ talloc_free(res);
return WERR_BADFILE;
+ }
if ((data_type != NULL) && (data != NULL)) {
reg_ldb_unpack_value(mem_ctx, res->msgs[0], name, data_type,
ldb_msg_add_empty(msg, "type", LDB_FLAG_MOD_DELETE, NULL);
ret = ldb_modify(kd->ldb, msg);
+
+ talloc_free(msg);
+
if (ret != LDB_SUCCESS) {
DEBUG(1, ("ldb_del_value: %s\n", ldb_errstring(kd->ldb)));
return WERR_FOOBAR;
}
}
}
+ talloc_free(res_keys);
+ talloc_free(res_vals);
/* Delete the key itself */
ret = ldb_delete(c, ldb_path);
ret = LDB_SUCCESS;
}
+ talloc_free(msg);
+
if (ret != LDB_SUCCESS) {
DEBUG(1, ("ldb_set_value: %s\n", ldb_errstring(kd->ldb)));
talloc_free(mem_ctx);