From: Ken Raeburn Date: Wed, 6 Aug 2008 16:46:25 +0000 (+0000) Subject: In loop over entries, make local vars local to each iteration X-Git-Tag: krb5-1.7-alpha1~526 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a91c58d3cfa72b2fdd3b32812c896ad92c6f9441;p=krb5.git In loop over entries, make local vars local to each iteration git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20618 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kdb/kdb_convert.c b/src/lib/kdb/kdb_convert.c index 63ddf9f36..db0a2c579 100644 --- a/src/lib/kdb/kdb_convert.c +++ b/src/lib/kdb/kdb_convert.c @@ -625,19 +625,10 @@ ulog_conv_2dbentry(krb5_context context, krb5_db_entry *entries, kdb_incr_update_t *updates, int nentries) { - int i, j, k, cnt, mod_time = 0, nattrs, nprincs; - krb5_principal mod_princ = NULL; - krb5_principal dbprinc; - char *dbprincstr = NULL; - + int k; krb5_db_entry *ent; kdb_incr_update_t *upd; - krb5_tl_data *newtl = NULL; - krb5_error_code ret; - unsigned int more; - unsigned int prev_n_keys = 0; - if ((updates == NULL) || (entries == NULL)) return (KRB5KRB_ERR_GENERIC); @@ -645,7 +636,15 @@ ulog_conv_2dbentry(krb5_context context, krb5_db_entry *entries, upd = updates; for (k = 0; k < nentries; k++) { - cnt = nprincs = 0; + krb5_principal mod_princ = NULL; + int i, j, cnt = 0, mod_time = 0, nattrs, nprincs = 0; + krb5_principal dbprinc; + char *dbprincstr = NULL; + + krb5_tl_data *newtl = NULL; + krb5_error_code ret; + unsigned int more; + unsigned int prev_n_keys = 0; /* * If the ulog entry represents a DELETE update, @@ -851,6 +850,7 @@ ulog_conv_2dbentry(krb5_context context, krb5_db_entry *entries, ret = krb5_dbe_update_mod_princ_data(context, ent, mod_time, mod_princ); krb5_free_principal(context, mod_princ); + mod_princ = NULL; if (ret) return (ret); }