mirror of
https://github.com/sheumann/hush.git
synced 2025-02-23 02:29:20 +00:00
- fix segfault in reset_ino_dev_hashtable() when *hashtable was null.
Seen in the testsuite for du -l .../testsuite on exit with CLEAN_UP enabled.
This commit is contained in:
parent
7d6c9296e7
commit
bdd253e450
@ -235,10 +235,8 @@ int du_main(int argc, char **argv)
|
|||||||
total += du(*argv);
|
total += du(*argv);
|
||||||
slink_depth = slink_depth_save;
|
slink_depth = slink_depth_save;
|
||||||
} while (*++argv);
|
} while (*++argv);
|
||||||
#if ENABLE_FEATURE_CLEAN_UP
|
if (ENABLE_FEATURE_CLEAN_UP)
|
||||||
reset_ino_dev_hashtable();
|
reset_ino_dev_hashtable();
|
||||||
#endif
|
|
||||||
|
|
||||||
if (print_final_total) {
|
if (print_final_total) {
|
||||||
print(total, "total");
|
print(total, "total");
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ void reset_ino_dev_hashtable(void)
|
|||||||
int i;
|
int i;
|
||||||
ino_dev_hashtable_bucket_t *bucket;
|
ino_dev_hashtable_bucket_t *bucket;
|
||||||
|
|
||||||
for (i = 0; i < HASH_SIZE; i++) {
|
for (i = 0; ino_dev_hashtable && i < HASH_SIZE; i++) {
|
||||||
while (ino_dev_hashtable[i] != NULL) {
|
while (ino_dev_hashtable[i] != NULL) {
|
||||||
bucket = ino_dev_hashtable[i]->next;
|
bucket = ino_dev_hashtable[i]->next;
|
||||||
free(ino_dev_hashtable[i]);
|
free(ino_dev_hashtable[i]);
|
||||||
@ -87,4 +87,6 @@ void reset_ino_dev_hashtable(void)
|
|||||||
free(ino_dev_hashtable);
|
free(ino_dev_hashtable);
|
||||||
ino_dev_hashtable = NULL;
|
ino_dev_hashtable = NULL;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
void reset_ino_dev_hashtable(void);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user