diff options
author | cperciva <cperciva@FreeBSD.org> | 2005-08-09 09:49:01 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2005-08-09 09:49:01 +0000 |
commit | 1e9ecd7ff53100227c15d4a41368b447b67fc2d7 (patch) | |
tree | f0ba2efaae866ad26517187229b8cd7222b4eef9 /usr.sbin/portsnap | |
parent | ed93898ca2aeee26e9aa745a6388cefa5a5fe0e8 (diff) | |
download | FreeBSD-src-1e9ecd7ff53100227c15d4a41368b447b67fc2d7.zip FreeBSD-src-1e9ecd7ff53100227c15d4a41368b447b67fc2d7.tar.gz |
Check that malloc() succeeds in makelist.
Submitted by: Roman Divacky (who did a very complete review of both
make_index.c and phttpget.c)
Diffstat (limited to 'usr.sbin/portsnap')
-rw-r--r-- | usr.sbin/portsnap/make_index/make_index.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/portsnap/make_index/make_index.c b/usr.sbin/portsnap/make_index/make_index.c index 6139fad..fbb8dd9 100644 --- a/usr.sbin/portsnap/make_index/make_index.c +++ b/usr.sbin/portsnap/make_index/make_index.c @@ -116,6 +116,8 @@ makelist(char * str, size_t * n) /* Allocate and fill an array */ d = malloc(*n * sizeof(DEP)); + if (d == NULL) + err(1, "malloc(DEP)"); for (i = 0; i < *n; i++) { d[i].name = strdup2(strsep(&str, " ")); |