[ostree] core: Actually allow none in ostree_parse_refspec()



commit f2b2d7c3f2f773d74244f7c141f55af3efd60517
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Apr 6 12:08:27 2015 -0400

    core: Actually allow none in ostree_parse_refspec()
    
    Both 'out_remote' and 'out_ref' parameters already have the (allow-none)
    annotation but that wasn't actually true.

 src/libostree/ostree-core.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c
index 81319f7..077c666 100644
--- a/src/libostree/ostree-core.c
+++ b/src/libostree/ostree-core.c
@@ -124,7 +124,7 @@ ostree_parse_refspec (const char   *refspec,
 {
   gboolean ret = FALSE;
   GMatchInfo *match = NULL;
-  char *remote;
+  gs_free char *remote = NULL;
 
   static gsize regex_initialized;
   static GRegex *regex;
@@ -155,8 +155,10 @@ ostree_parse_refspec (const char   *refspec,
     }
 
   ret = TRUE;
-  *out_remote = remote;
-  *out_ref = g_match_info_fetch (match, 2);
+
+  gs_transfer_out_value (out_remote, &remote);
+  if (out_ref != NULL)
+    *out_ref = g_match_info_fetch (match, 2);
  out:
   if (match)
     g_match_info_unref (match);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]