svn commit: r278173 - head/usr.sbin/pkg

Baptiste Daroussin bapt at FreeBSD.org
Wed Feb 4 00:18:07 UTC 2015


Author: bapt
Date: Wed Feb  4 00:18:06 2015
New Revision: 278173
URL: https://svnweb.freebsd.org/changeset/base/278173

Log:
  Test the return of fetchParseURL(3)
  
  CID:		1125811
  MFC after:	1 week

Modified:
  head/usr.sbin/pkg/pkg.c

Modified: head/usr.sbin/pkg/pkg.c
==============================================================================
--- head/usr.sbin/pkg/pkg.c	Wed Feb  4 00:10:57 2015	(r278172)
+++ head/usr.sbin/pkg/pkg.c	Wed Feb  4 00:18:06 2015	(r278173)
@@ -202,7 +202,11 @@ fetch_to_fd(const char *url, char *path)
 
 	retry = max_retry;
 
-	u = fetchParseURL(url);
+	if ((u = fetchParseURL(url)) == NULL) {
+		warn("fetchParseURL('%s')", url);
+		return (-1);
+	}
+
 	while (remote == NULL) {
 		if (retry == max_retry) {
 			if (strcmp(u->scheme, "file") != 0 &&


More information about the svn-src-all mailing list