mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-10-31 00:12:19 +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:
		| @@ -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; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user