Date: Fri, 28 Sep 2012 01:04:09 +0000 (UTC) From: Eitan Adler <eadler@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r241016 - stable/9/lib/libfetch Message-ID: <201209280104.q8S149DB039543@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: eadler Date: Fri Sep 28 01:04:09 2012 New Revision: 241016 URL: http://svn.freebsd.org/changeset/base/241016 Log: MFC r240495: Adding missing return statements during error conditions. PR: kern/171187 Approved by: cperciva (implicit) Modified: stable/9/lib/libfetch/file.c Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/file.c ============================================================================== --- stable/9/lib/libfetch/file.c Thu Sep 27 23:31:19 2012 (r241015) +++ stable/9/lib/libfetch/file.c Fri Sep 28 01:04:09 2012 (r241016) @@ -50,12 +50,15 @@ fetchXGetFile(struct url *u, struct url_ f = fopen(u->doc, "r"); - if (f == NULL) + if (f == NULL) { fetch_syserr(); + return (NULL); + } if (u->offset && fseeko(f, u->offset, SEEK_SET) == -1) { fclose(f); fetch_syserr(); + return (NULL); } fcntl(fileno(f), F_SETFD, FD_CLOEXEC); @@ -78,12 +81,15 @@ fetchPutFile(struct url *u, const char * else f = fopen(u->doc, "w+"); - if (f == NULL) + if (f == NULL) { fetch_syserr(); + return (NULL); + } if (u->offset && fseeko(f, u->offset, SEEK_SET) == -1) { fclose(f); fetch_syserr(); + return (NULL); } fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209280104.q8S149DB039543>