Author: eadler
Date: Fri Sep 14 12:15:13 2012
New Revision: 240495
URL: http://svn.freebsd.org/changeset/base/240495

Log:
  Adding missing return statements during error conditions.
  
  PR:           kern/171187
  Submitted by: Mark Johnston <mark...@gmail.com>
  Reviewed by:  des
  Approved by:  cperciva
  MFC after:    2 weeks

Modified:
  head/lib/libfetch/file.c

Modified: head/lib/libfetch/file.c
==============================================================================
--- head/lib/libfetch/file.c    Fri Sep 14 11:51:49 2012        (r240494)
+++ head/lib/libfetch/file.c    Fri Sep 14 12:15:13 2012        (r240495)
@@ -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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to