mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-28 02:20:04 +01:00
gprintf: Fix a memory leak with an invalid format in g_vasprintf()
If using the fallback implementation of `g_vasprintf()`. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Coverity CID: #1474726
This commit is contained in:
parent
b3a568d19e
commit
7329c6e09b
@ -356,6 +356,12 @@ g_vasprintf (gchar **string,
|
||||
|
||||
len = _g_vsprintf (*string, format, args2);
|
||||
va_end (args2);
|
||||
|
||||
if (len < 0)
|
||||
{
|
||||
g_free (*string);
|
||||
*string = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user