Date: Wed, 1 Jun 2016 17:30:50 +0000 (UTC) From: Don Lewis <truckman@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301147 - stable/10/bin/mv Message-ID: <201606011730.u51HUoAB054571@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: truckman Date: Wed Jun 1 17:30:50 2016 New Revision: 301147 URL: https://svnweb.freebsd.org/changeset/base/301147 Log: MFC r300643 Close from_fd if malloc() fails to avoid a file descriptor leak. Reported by: Coverity CID: 1007203 Modified: stable/10/bin/mv/mv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/mv/mv.c ============================================================================== --- stable/10/bin/mv/mv.c Wed Jun 1 17:29:15 2016 (r301146) +++ stable/10/bin/mv/mv.c Wed Jun 1 17:30:50 2016 (r301147) @@ -285,6 +285,7 @@ fastcopy(const char *from, const char *t } if (bp == NULL && (bp = malloc((size_t)blen)) == NULL) { warnx("malloc(%u) failed", blen); + (void)close(from_fd); return (1); } while ((to_fd =
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606011730.u51HUoAB054571>