mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-09 18:54:04 +02: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:
@@ -1973,6 +1973,12 @@ g_uri_params_iter_next (GUriParamsIter *iter,
|
|||||||
g_return_val_if_fail (iter != NULL, FALSE);
|
g_return_val_if_fail (iter != NULL, FALSE);
|
||||||
g_return_val_if_fail (error == NULL || *error == 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)
|
if (ri->attr >= ri->end)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user