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:
Philip Withnall 2014-05-15 10:15:26 +01:00
parent 4360756c69
commit 46b7217fbf

View File

@ -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;
}