mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gtestutils: Don’t free unassigned variables in an error path
If the stream is invalid, msg.nums and msg.strings have not been assigned to, so don’t free them. Coverity issue: #1159505
This commit is contained in:
parent
4360756c69
commit
46b7217fbf
@ -3057,9 +3057,11 @@ g_test_log_extract (GTestLogBuffer *tbuffer)
|
||||
tbuffer->msgs = g_slist_prepend (tbuffer->msgs, g_memdup (&msg, sizeof (msg)));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
g_free (msg.nums);
|
||||
g_strfreev (msg.strings);
|
||||
}
|
||||
g_free (msg.nums);
|
||||
g_strfreev (msg.strings);
|
||||
|
||||
g_error ("corrupt log stream from test program");
|
||||
return FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user