X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/31d0247cc58abc0b0720aa7e9972011c5a66995c..d04c0e00da3a27693bbf9cc4f2d5c88e56d80f20:/sys/mdup.c diff --git a/sys/mdup.c b/sys/mdup.c index e4cb260..ed483bb 100644 --- a/sys/mdup.c +++ b/sys/mdup.c @@ -32,6 +32,7 @@ #include +#include "alloc.h" #include "mdup.h" /*----- Data structures ---------------------------------------------------*/ @@ -376,7 +377,7 @@ int mdup(mdup_fd *v, size_t n) * way. */ - if ((vv = malloc(sizeof(*vv) * n)) == 0) + if (!NEWV_SAFE_P(vv, n) || (vv = malloc(n*sizeof(*vv))) == 0) return (-1); dhead = 0;