bin/refs: Fix error handling logic
authorColin Walters <walters@verbum.org>
Mon, 31 Jul 2017 13:30:09 +0000 (09:30 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 2 Aug 2017 15:34:16 +0000 (15:34 +0000)
Spotted by Coverity.

Coverity CID: 1452202

Closes: #1037
Approved by: jlebon

src/ostree/ot-builtin-refs.c

index 1942084245299d0ed226bbaaaebc0bdcd3c52e98..f2274802281ceee8b8e02e647e8acfa849ad5abd 100644 (file)
@@ -264,7 +264,8 @@ ostree_builtin_refs (int argc, char **argv, GCancellable *cancellable, GError **
           goto out;
         }
 
-      ret = do_ref (repo, NULL, cancellable, error);
+      if (!do_ref (repo, NULL, cancellable, error))
+        goto out;
     }
 
   ret = TRUE;