diff options
author | sjg <sjg@FreeBSD.org> | 2015-05-27 01:19:58 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2015-05-27 01:19:58 +0000 |
commit | 65145fa4c81da358fcbc3b650156dab705dfa34e (patch) | |
tree | 55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /usr.bin/du | |
parent | 60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff) | |
parent | e6b664c390af88d4a87208bc042ce503da664c3b (diff) | |
download | FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz |
Merge sync of head
Diffstat (limited to 'usr.bin/du')
-rw-r--r-- | usr.bin/du/Makefile | 3 | ||||
-rw-r--r-- | usr.bin/du/du.c | 7 |
2 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/du/Makefile b/usr.bin/du/Makefile index f614866..9f96ec6 100644 --- a/usr.bin/du/Makefile +++ b/usr.bin/du/Makefile @@ -2,7 +2,6 @@ # $FreeBSD$ PROG= du -DPADD= ${LIBUTIL} -LDADD= -lutil +LIBADD= util .include <bsd.prog.mk> diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index 6194a12..506c3f5 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -376,7 +376,7 @@ linkchk(FTSENT *p) /* If the hash table is getting too full, enlarge it. */ if (number_entries > number_buckets * 10 && !stop_allocating) { new_size = number_buckets * 2; - new_buckets = malloc(new_size * sizeof(struct links_entry *)); + new_buckets = calloc(new_size, sizeof(struct links_entry *)); /* Try releasing the free list to see if that helps. */ if (new_buckets == NULL && free_list != NULL) { @@ -385,16 +385,13 @@ linkchk(FTSENT *p) free_list = le->next; free(le); } - new_buckets = malloc(new_size * - sizeof(new_buckets[0])); + new_buckets = calloc(new_size, sizeof(new_buckets[0])); } if (new_buckets == NULL) { stop_allocating = 1; warnx("No more memory for tracking hard links"); } else { - memset(new_buckets, 0, - new_size * sizeof(struct links_entry *)); for (i = 0; i < number_buckets; i++) { while (buckets[i] != NULL) { /* Remove entry from old bucket. */ |