diff -urp bleeding-jumbo.orig/src/loader.c bleeding-jumbo-opt/src/loader.c --- bleeding-jumbo.orig/src/loader.c 2015-09-03 04:37:15 +0000 +++ bleeding-jumbo-opt/src/loader.c 2015-09-15 19:22:03 +0000 @@ -1051,6 +1054,7 @@ static void ldr_load_pot_line(struct db_ char *ciphertext; void *binary; int hash; + int need_removal; struct db_password *current; ciphertext = ldr_get_field(&line, db->options->field_sep_char); @@ -1058,6 +1062,7 @@ static void ldr_load_pot_line(struct db_ ciphertext = format->methods.split(ciphertext, 0, format); binary = format->methods.binary(ciphertext); hash = db->password_hash_func(binary); + need_removal = 0; if ((current = db->password_hash[hash])) do { @@ -1072,7 +1077,11 @@ static void ldr_load_pot_line(struct db_ format->methods.source(current->source, current->binary))) continue; current->binary = NULL; /* mark for removal */ + need_removal = 1; } while ((current = current->next_hash)); + + if (need_removal) + db->options->flags |= DB_NEED_REMOVAL; } void ldr_load_pot_file(struct db_main *db, char *name) @@ -1323,6 +1332,9 @@ static void ldr_remove_marked(struct db_ struct db_salt *current_salt, *last_salt; struct db_password *current_pw, *last_pw; + if (!(db->options->flags & DB_NEED_REMOVAL)) + return; + last_salt = NULL; if ((current_salt = db->salts)) do { @@ -1354,6 +1366,8 @@ static void ldr_remove_marked(struct db_ } else last_salt = current_salt; } while ((current_salt = current_salt->next)); + + db->options->flags &= ~DB_NEED_REMOVAL; } /* diff -urp bleeding-jumbo.orig/src/loader.h bleeding-jumbo-opt/src/loader.h --- bleeding-jumbo.orig/src/loader.h 2015-08-06 13:25:11 +0000 +++ bleeding-jumbo-opt/src/loader.h 2015-09-15 19:12:04 +0000 @@ -169,6 +169,8 @@ struct db_cracked { #define DB_SPLIT 0x00000010 /* Duplicate hashes were seen and excluded */ #define DB_NODUP 0x00000020 +/* Some entries are marked for removal */ +#define DB_NEED_REMOVAL 0x00000080 /* Cracked passwords only (ciphertext, plaintext) */ #define DB_CRACKED 0x00000100 /* Cracked plaintexts list */