]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:kdc: Remove unnecessary assignments
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 27 Sep 2023 01:00:07 +0000 (14:00 +1300)
committerJoseph Sutton <jsutton@samba.org>
Sun, 1 Oct 2023 22:45:38 +0000 (22:45 +0000)
These structures have been zero‐initialized already.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/kdc/sdb_to_hdb.c

index a42d460a7687985bdf0de4faabd0e0a4a2bab531..4c4f2a576266560465a774f23d24005555e391ce 100644 (file)
@@ -83,7 +83,6 @@ static int sdb_salt_to_Salt(const struct sdb_salt *s, Salt *h)
                free_Salt(h);
                return ENOMEM;
        }
-       h->opaque = NULL;
 
        return 0;
 }
@@ -113,8 +112,6 @@ static int sdb_key_to_Key(const struct sdb_key *s, Key *h)
                if (rc != 0) {
                        goto error_nomem;
                }
-       } else {
-               h->salt = NULL;
        }
 
        return 0;
@@ -145,8 +142,6 @@ static int sdb_keys_to_Keys(const struct sdb_keys *s, Keys *h)
 
                        ++h->len;
                }
-       } else {
-               h->val = NULL;
        }
 
        return 0;
@@ -192,8 +187,6 @@ static int sdb_event_to_Event(krb5_context context,
                        free_Event(h);
                        return ret;
                }
-       } else {
-               h->principal = NULL;
        }
        h->time = s->time;
 
@@ -266,8 +259,6 @@ int sdb_entry_to_hdb_entry(krb5_context context,
                if (rc != 0) {
                        goto error;
                }
-       } else {
-               h->modified_by = NULL;
        }
 
        if (s->valid_start != NULL) {
@@ -277,8 +268,6 @@ int sdb_entry_to_hdb_entry(krb5_context context,
                        goto error;
                }
                *h->valid_start = *s->valid_start;
-       } else {
-               h->valid_start = NULL;
        }
 
        if (s->valid_end != NULL) {
@@ -288,8 +277,6 @@ int sdb_entry_to_hdb_entry(krb5_context context,
                        goto error;
                }
                *h->valid_end = *s->valid_end;
-       } else {
-               h->valid_end = NULL;
        }
 
        if (s->pw_end != NULL) {
@@ -299,8 +286,6 @@ int sdb_entry_to_hdb_entry(krb5_context context,
                        goto error;
                }
                *h->pw_end = *s->pw_end;
-       } else {
-               h->pw_end = NULL;
        }
 
        if (s->max_life != NULL) {
@@ -310,8 +295,6 @@ int sdb_entry_to_hdb_entry(krb5_context context,
                        goto error;
                }
                *h->max_life = *s->max_life;
-       } else {
-               h->max_life = NULL;
        }
 
        if (s->max_renew != NULL) {
@@ -321,13 +304,10 @@ int sdb_entry_to_hdb_entry(krb5_context context,
                        goto error;
                }
                *h->max_renew = *s->max_renew;
-       } else {
-               h->max_renew = NULL;
        }
 
        sdb_flags_to_hdb_flags(&s->flags, &h->flags);
 
-       h->etypes = NULL;
        if (s->etypes != NULL) {
                h->etypes = malloc(sizeof(*h->etypes));
                if (h->etypes == NULL) {
@@ -348,7 +328,6 @@ int sdb_entry_to_hdb_entry(krb5_context context,
                }
        }
 
-       h->session_etypes = NULL;
        if (s->session_etypes != NULL) {
                h->session_etypes = malloc(sizeof(*h->session_etypes));
                if (h->session_etypes == NULL) {