lib/repo: Add (transfer) annotations to various GHashTable arguments
By default, unless it’s const, an (out) GHashTable will be assumed to be (transfer full). That means the binding needs to free all the items in the hash table, plus the table itself. However, all the GHashTables we use have free functions set already, so freeing the hash table will free its items. This results in a double-free. Fix that by ensuring we annotate such (out) hash tables as (transfer container). Also annotate some other hash tables as (transfer none) where appropriate, for clarity. This fixes OSTree.Repo.list_collection_refs() in the Python bindings. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1341 Approved by: dbnicholson
This commit is contained in:
1 parent
6b9ce9d35d
commit
f7568dbfc8
4 files changed
+14
-9
No files matched your search
@@ -1281,7 +1281,7 @@ soup_uri_set_query (SoupURI *uri, const char *query)
|
||||
/**
|
||||
* soup_uri_set_query_from_form:
|
||||
* @uri: a #SoupURI
|
||||
* @form: (element-type utf8 utf8): a #GHashTable containing HTML form
|
||||
* @form: (element-type utf8 utf8) (transfer none): a #GHashTable containing HTML form
|
||||
* information
|
||||
*
|
||||
* Sets @uri's query to the result of encoding @form according to the
|
||||
|
||||
Reference in new issue
Block a user