| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
The parameters are not optional as they are always accessed. They can be NULL
when the iter is finished, actually always set it so that we are sure to
always have an initialized variable
|
|
|
|
|
|
|
| |
RestParams was implemented as HashTable. Limitations are that it did
not preserved the order of individual parameters aswell as duplicates
aren't allowed. Reworked it to a GList and introduced reference counting
and a boxed type.
|
|
|
|
| |
Most of them are taken from the Vala overrides: https://gitlab.gnome.org/GNOME/vala/-/blob/master/vapi/metadata/Rest-0.7.metadata
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rest_params_add() is currently using g_hash_table_insert() to add
the passed in parameter in the parameter hash table. The key which
is used is owned by the associated value.
When using rest_params_add to replace an already existing parameter,
the existing value will be freed with rest_param_unref().
However, g_hash_table_insert() does not replace the key when it already
exists in the hash table: "If the key already exists in the GHashTable
its current value is replaced with the new value... If you supplied a
key_destroy_func when creating the GHashTable, the passed key is freed
using that function."
This means that after replacing an already existing parameter, the
corresponding key will still be the old one, which is now pointing
at freed memory as the old value was freed.
g_hash_table_replace() ensures that the key will still be valid, even
when replacing existing parameters:
"Inserts a new key and value into a GHashTable similar to
g_hash_table_insert(). The difference is that if the key already exists
in the GHashTable, it gets replaced by the new key."
https://bugzilla.gnome.org/show_bug.cgi?id=665716
|
|
|
|
| |
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=675213
|
| |
|
| |
|
|
|