From d730ec8a64a332a651982acc684deff65ed5cff1 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 20 Jul 2012 20:04:11 -0500 Subject: [PATCH] main: bail if the entire depgraph cannot be built --- main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 7cea5ee..ff40e85 100644 --- a/main.c +++ b/main.c @@ -267,12 +267,19 @@ pkg_queue_walk(pkg_queue_t *head) pkg_dependency_t *pkgdep; pkgdep = pkg_dependency_parse(&world, pkgq->package); - world.requires = pkg_dependency_append(world.requires, pkgdep); + if (pkgdep != NULL) + world.requires = pkg_dependency_append(world.requires, pkgdep); + else + retval = EXIT_FAILURE; free(pkgq->package); free(pkgq); } + /* we couldn't build the entire depgraph, so bail. */ + if (retval != EXIT_SUCCESS) + goto out; + /* we should verify that the graph is complete before attempting to compute cflags etc. */ if (pkg_verify_graph(&world, maximum_traverse_depth, global_traverse_flags) != PKG_ERRF_OK) {