mirror of
https://github.com/simh/simh.git
synced 2026-01-13 15:27:14 +00:00
slirp: Fix g_array_free to correctly handle freeing an unallocateed GArray. Fix #243
This commit is contained in:
parent
7ad57d7fa8
commit
480c71dea5
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user