refs: Add a missing `goto out` for error handling
authorColin Walters <walters@verbum.org>
Tue, 26 Jan 2016 21:48:37 +0000 (16:48 -0500)
committerColin Walters <walters@verbum.org>
Tue, 26 Jan 2016 21:48:37 +0000 (16:48 -0500)
If the `refs/remotes` directory doesn't exist, we'd trip an assertion.

src/libostree/ostree-repo-refs.c

index 6d3bd51e65c6713cc1dacddb0a253198d0c1a2aa..4fc415b2cabbd322009d30cd01470e2f50812afb 100644 (file)
@@ -551,6 +551,8 @@ ostree_repo_list_refs (OstreeRepo       *self,
       remote_enumerator = g_file_enumerate_children (self->remote_heads_dir, OSTREE_GIO_FAST_QUERYINFO,
                                                      0,
                                                      cancellable, error);
+      if (!remote_enumerator)
+        goto out;
 
       while (TRUE)
         {