1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

lib;smbd: Fix the -Os build by initializing variables

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2021-07-23 08:46:51 +02:00 committed by Jeremy Allison
parent fa8c0379b5
commit 621f561a9c
6 changed files with 20 additions and 23 deletions

View File

@ -990,8 +990,8 @@ static int ctl_get_member_attributes(struct mscat_ctl *ctl,
ok = mscat_asn1_oid_equal(oid, CAT_MEMBERINFO_OBJID);
if (ok) {
char *name;
uint32_t id;
char *name = NULL;
uint32_t id = 0;
rc = ctl_parse_member_info(ctl,
tmp_ctx,

View File

@ -136,12 +136,9 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset
out:
if (socket_flags_changed) {
int saved_errno;
int saved_errno = errno;
int err;
if (ret == -1) {
saved_errno = errno;
}
/* Restore the old state of the socket. */
err = fcntl(tofd, F_SETFL, old_flags);
if (err == -1) {

View File

@ -3699,11 +3699,11 @@ WERROR winreg_get_driver(TALLOC_CTX *mem_ctx,
{
uint32_t access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
struct policy_handle hive_hnd, key_hnd;
struct spoolss_DriverInfo8 i8, *info8;
struct spoolss_DriverInfo8 i8, *info8 = NULL;
struct spoolss_PrinterEnumValues *enum_values = NULL;
struct spoolss_PrinterEnumValues *v;
struct spoolss_PrinterEnumValues *v = NULL;
uint32_t num_values = 0;
TALLOC_CTX *tmp_ctx;
TALLOC_CTX *tmp_ctx = NULL;
WERROR result;
NTSTATUS status;
uint32_t i;
@ -4168,15 +4168,15 @@ WERROR winreg_get_core_driver(TALLOC_CTX *mem_ctx,
{
uint32_t access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
struct policy_handle hive_hnd, key_hnd;
struct spoolss_CorePrinterDriver *c;
struct spoolss_CorePrinterDriver *c = NULL;
struct spoolss_PrinterEnumValues *enum_values = NULL;
struct spoolss_PrinterEnumValues *v;
struct spoolss_PrinterEnumValues *v = NULL;
uint32_t num_values = 0;
TALLOC_CTX *tmp_ctx;
TALLOC_CTX *tmp_ctx = NULL;
WERROR result;
NTSTATUS status;
const char *path;
const char *guid_str;
const char *path = NULL;
const char *guid_str = NULL;
uint32_t i;
const char **enum_names = NULL;
enum winreg_Type *enum_types = NULL;
@ -4505,12 +4505,12 @@ WERROR winreg_get_driver_package(TALLOC_CTX *mem_ctx,
uint32_t access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
struct policy_handle hive_hnd, key_hnd;
struct spoolss_PrinterEnumValues *enum_values = NULL;
struct spoolss_PrinterEnumValues *v;
struct spoolss_PrinterEnumValues *v = NULL;
uint32_t num_values = 0;
TALLOC_CTX *tmp_ctx;
TALLOC_CTX *tmp_ctx = NULL;
WERROR result;
NTSTATUS status;
const char *path;
const char *path = NULL;
uint32_t i;
const char **enum_names = NULL;
enum winreg_Type *enum_types = NULL;

View File

@ -336,11 +336,11 @@ static bool notifyd_apply_rec_change(
struct sys_notify_context *sys_notify_ctx,
struct messaging_context *msg_ctx)
{
struct db_record *rec;
struct notifyd_instance *instances;
struct db_record *rec = NULL;
struct notifyd_instance *instances = NULL;
size_t num_instances;
size_t i;
struct notifyd_instance *instance;
struct notifyd_instance *instance = NULL;
TDB_DATA value;
NTSTATUS status;
bool ok = false;

View File

@ -51,7 +51,7 @@ int linux_set_lease_sighandler(int fd)
int linux_setlease(int fd, int leasetype)
{
int ret;
int saved_errno;
int saved_errno = 0;
/*
* Ensure the lease owner is root to allow

View File

@ -116,7 +116,7 @@ static bool test_find(struct torture_context *tctx,
NTSTATUS status;
bool ret = true;
unsigned int count;
int i, j, file_count = 0;
int i, j = 0, file_count = 0;
status = populate_tree(tctx, mem_ctx, tree, files, NFILES, &h);
@ -1300,7 +1300,7 @@ static bool test_large_files(struct torture_context *tctx,
struct smb2_find f;
struct smb2_handle h = {{0}};
union smb_search_data *d;
int i, j, file_count = 0;
int i, j = 0, file_count = 0;
char **strs = NULL;
unsigned count;