{
NTSTATUS status;
char *filter;
- char *error_string;
+ char *error_string = NULL;
/* Bleh, nasty recursion issues: We are setting a machine
* account here, so we don't want the 'pending' flag around
* any more */
SECRETS_PRINCIPALS_DN, filter,
0, NULL, &error_string);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(1, ("Could not find %s principal in secrets database: %s: %s\n", serviceprincipal, nt_errstr(status), error_string));
+ DEBUG(1, ("Could not find %s principal in secrets database: %s: %s\n",
+ serviceprincipal, nt_errstr(status),
+ error_string ? error_string : "<no error>"));
}
return status;
}
/* Generate new list of subtrees */
j = 0;
for (i = 0; i < tree->u.list.num_elements; i++) {
- struct ldb_parse_tree *child;
+ struct ldb_parse_tree *child = NULL;
ret = map_subtree_select_local(module, *new, &child, tree->u.list.elements[i]);
if (ret) {
talloc_free(*new);
{
struct ctdbd_connection *conn = talloc_get_type_abort(
private_data, struct ctdbd_connection);
- struct ctdb_req_header *hdr;
+ struct ctdb_req_header *hdr = NULL;
NTSTATUS status;
status = ctdb_read_packet(conn->fd, talloc_tos(), &hdr);
{
NTSTATUS status;
TDB_DATA data;
- int32_t cstatus;
+ int32_t cstatus = 0;
data.dptr = (uint8_t*)&db_id;
data.dsize = sizeof(db_id);
}
while (True) {
- struct ctdb_req_header *hdr;
+ struct ctdb_req_header *hdr = NULL;
struct ctdb_req_message *m;
struct ctdb_rec_data *d;
}
for (i=0; i < info_ctr.ctr.ctr2->count; i++) {
- union srvsvc_NetFileInfo _i;
+ union srvsvc_NetFileInfo _i = {0};
switch (r->in.level) {
case 2:
_i.info2 = &info_ctr.ctr.ctr2->array[i];
}
for (i=0; i < info_ctr.ctr.ctr1->count; i++) {
- union srvsvc_NetShareInfo _i;
+ union srvsvc_NetShareInfo _i = {0};
switch (r->in.level) {
case 0:
_i.info0 = &info_ctr.ctr.ctr0->array[i];
{
NTSTATUS status;
struct ldapsam_privates *ldap_state;
- char *dn;
+ char *dn = NULL;
uint32_t has_objectclass = 0;
ldap_state = (struct ldapsam_privates *)(pdb_methods->private_data);
{
WERROR werr;
enum winreg_CreateAction action;
- char *subkeyname;
+ char *subkeyname = NULL;
struct registry_key *hivekey = NULL;
struct registry_key *subkey = NULL;
TALLOC_CTX *ctx = talloc_stackframe();
bool recursive)
{
WERROR werr;
- char *subkeyname;
+ char *subkeyname = NULL;
struct registry_key *hivekey = NULL;
TALLOC_CTX *ctx = talloc_stackframe();
int ret = -1;
"transportType", "schedule", "options",
"enabledConnection", NULL };
unsigned int i, valid_connections;
- struct GUID_list keep_connections;
+ struct GUID_list keep_connections = {0};
tmp_ctx = talloc_new(service);
NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
struct GUID other_site_id;
struct kcctpl_vertex *other_site_vertex;
struct ldb_result *res;
- struct ldb_message *transport, *r_bridgehead, *l_bridgehead;
+ struct ldb_message *transport, *r_bridgehead;
+ struct ldb_message *l_bridgehead = NULL;
uint8_t schedule[84];
uint32_t first_available, j, interval;
{
NTSTATUS status;
TALLOC_CTX *tmp_ctx = talloc_new(service);
- struct GUID_list keep;
- bool all_connected;
+ struct GUID_list keep = {0};
+ bool all_connected = false;
DEBUG(5, ("Testing kcctpl_create_intersite_connections\n"));
status = kcctpl_create_intersite_connections(service, tmp_ctx, &keep,
{
krb5_fcache *f = FCACHE(id);
int ret = 0;
- int fd;
+ int fd = 0;
if (f == NULL)
return krb5_einval(context, 2);
krb5_creds *creds)
{
int ret;
- int fd;
+ int fd = 0;
ret = fcc_open(context, id, &fd, O_WRONLY | O_APPEND | O_BINARY | O_CLOEXEC, 0);
if(ret)
int *ret_fd,
krb5_deltat *kdc_offset)
{
- int fd;
+ int fd = 0;
int8_t pvno, tag;
krb5_storage *sp;
krb5_error_code ret;
} else if (ret && errno == EXDEV) {
/* make a copy and delete the orignal */
krb5_ssize_t sz1, sz2;
- int fd1, fd2;
+ int fd1;
+ int fd2 = 0;
char buf[BUFSIZ];
ret = fcc_open(context, from, &fd1, O_RDONLY | O_BINARY | O_CLOEXEC, 0);
{
krb5_error_code ret;
krb5_storage *sp = NULL;
- int fd;
+ int fd = 0;
ret = init_fcc(context, id, &sp, &fd, kdc_offset);
if (sp)
krb5_storage_free(sp);
struct tevent_req *subreq;
struct http_auth_state *state;
NTSTATUS status;
- struct http_request *auth_request;
+ struct http_request *auth_request = NULL;
struct http_request *request_to_send;
req = tevent_req_create(mem_ctx, &state, struct http_auth_state);
struct tevent_req *req;
struct http_auth_state *state;
struct http_request *auth_response;
- struct http_request *auth_request;
+ struct http_request *auth_request = NULL;
struct http_request *request_to_send;
req = tevent_req_callback_data(subreq, struct tevent_req);
struct composite_context *c;
struct usermod_state *s;
union samr_UserInfo *i;
- uint16_t level;
+ uint16_t level = 0;
c = tevent_req_callback_data(subreq, struct composite_context);
s = talloc_get_type(c->private_data, struct usermod_state);
/* a simple wrapper around samr_CreateUser2 works nicely */
- r2.in.domain_handle = r->in.domain_handle;
- r2.in.account_name = r->in.account_name;
- r2.in.acct_flags = ACB_NORMAL;
- r2.in.access_mask = r->in.access_mask;
- r2.out.user_handle = r->out.user_handle;
- r2.out.access_granted = &access_granted;
- r2.out.rid = r->out.rid;
+
+ r2 = (struct samr_CreateUser2) {
+ .in.domain_handle = r->in.domain_handle,
+ .in.account_name = r->in.account_name,
+ .in.acct_flags = ACB_NORMAL,
+ .in.access_mask = r->in.access_mask,
+ .out.user_handle = r->out.user_handle,
+ .out.access_granted = &access_granted,
+ .out.rid = r->out.rid
+ };
return dcesrv_samr_CreateUser2(dce_call, mem_ctx, &r2);
}
struct samr_QueryUserInfo r1;
NTSTATUS status;
- r1.in.user_handle = r->in.user_handle;
- r1.in.level = r->in.level;
- r1.out.info = r->out.info;
+ r1 = (struct samr_QueryUserInfo) {
+ .in.user_handle = r->in.user_handle,
+ .in.level = r->in.level,
+ .out.info = r->out.info
+ };
status = dcesrv_samr_QueryUserInfo(dce_call, mem_ctx, &r1);
{
uint32_t rid = delta->delta_id_union.rid;
struct netr_DELTA_USER *user = delta->delta_union.user;
- struct netr_SamInfo3 *info3;
+ struct netr_SamInfo3 *info3 = NULL;
struct samr_Password lm_hash;
struct samr_Password nt_hash;
struct samr_Password *lm_hash_p = NULL;
int i;
for (i=0; i < ARRAY_SIZE(list); i++) {
- enum winreg_Type type, type_ex;
- uint8_t *data, *data_ex;
- uint32_t needed, needed_ex;
+ enum winreg_Type type = REG_NONE;
+ enum winreg_Type type_ex= REG_NONE;
+ uint8_t *data;
+ uint8_t *data_ex = NULL;
+ uint32_t needed;
+ uint32_t needed_ex = 0;
torture_assert(tctx, test_GetPrinterData(tctx, b, &ctx->server_handle, list[i], &type, &data, &needed),
talloc_asprintf(tctx, "GetPrinterData failed on %s\n", list[i]));
struct policy_handle *handle,
uint32_t *change_id)
{
- enum winreg_Type type;
- uint8_t *data;
- uint32_t needed;
+ enum winreg_Type type = REG_NONE;
+ uint8_t *data = NULL;
+ uint32_t needed = 0;
torture_assert(tctx,
test_GetPrinterDataEx(tctx, p, handle, "PrinterDriverData", "ChangeID", &type, &data, &needed),
fstring user)
{
char *p = strchr(domuser, winbind_separator(torture));
- char *dom;
+ char *dom = NULL;
if (!p) {
/* Maybe it was a UPN? */