mirror of
https://github.com/simh/simh.git
synced 2026-03-01 09:31:16 +00:00
slirp: Fix g_array_free to correctly handle freeing an unallocateed GArray. Fix #243
This commit is contained in:
@@ -300,11 +300,13 @@ gchar *
|
||||
g_array_free (GArray *array,
|
||||
gboolean free_segment)
|
||||
{
|
||||
gchar *result = free_segment ? NULL : array->data;
|
||||
gchar *result = ((array == NULL) || free_segment) ? NULL : array->data;
|
||||
|
||||
if (free_segment)
|
||||
free (array->data);
|
||||
free (array);
|
||||
if (array != NULL) {
|
||||
if (free_segment)
|
||||
free (array->data);
|
||||
free (array);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user