Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Sep 2012 01:04:10 +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-7@freebsd.org
Subject:   svn commit: r241018 - stable/7/lib/libfetch
Message-ID:  <201209280104.q8S14A5d039575@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Fri Sep 28 01:04:10 2012
New Revision: 241018
URL: http://svn.freebsd.org/changeset/base/241018

Log:
  MFC r240495:
  	Adding missing return statements during error conditions.
  
  PR:		kern/171187
  Approved by:	cperciva (implicit)

Modified:
  stable/7/lib/libfetch/file.c
Directory Properties:
  stable/7/lib/libfetch/   (props changed)

Modified: stable/7/lib/libfetch/file.c
==============================================================================
--- stable/7/lib/libfetch/file.c	Fri Sep 28 01:04:09 2012	(r241017)
+++ stable/7/lib/libfetch/file.c	Fri Sep 28 01:04:10 2012	(r241018)
@@ -49,12 +49,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);
 	}
 
 	return (f);
@@ -76,12 +79,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);
 	}
 
 	return (f);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209280104.q8S14A5d039575>