mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
guri: Clear return values on error from g_uri_params_iter_next()
This reduces the chance of the caller accidentally double-freeing or use-after-free-ing something. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
83597b9e57
commit
ceda9755de
@ -1973,6 +1973,12 @@ g_uri_params_iter_next (GUriParamsIter *iter,
|
||||
g_return_val_if_fail (iter != NULL, FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
/* Pre-clear these in case of failure or finishing. */
|
||||
if (attribute)
|
||||
*attribute = NULL;
|
||||
if (value)
|
||||
*value = NULL;
|
||||
|
||||
if (ri->attr >= ri->end)
|
||||
return FALSE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user