summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2019-02-25 12:39:06 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2019-02-25 12:39:06 +0000
commit25942f0176bcd10dbae598be07d207d214711f06 (patch)
tree2ac77010a70bd55eae506d3cc1cba7f67689b9ad
parent1fb31a16c306e3101c04074070ae1a154801d260 (diff)
parent7bf49c8df7858dd6df6f9b9312327d7a1e015573 (diff)
downloadgvdb-25942f0176bcd10dbae598be07d207d214711f06.tar.gz
Merge branch 'array-size' into 'master'
Fix size of preallocated array See merge request GNOME/gvdb!3
-rw-r--r--gvdb-reader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gvdb-reader.c b/gvdb-reader.c
index 9509388..ccae40e 100644
--- a/gvdb-reader.c
+++ b/gvdb-reader.c
@@ -462,7 +462,7 @@ gvdb_table_get_names (GvdbTable *table,
{
GPtrArray *fixed_names;
- fixed_names = g_ptr_array_sized_new (n_names);
+ fixed_names = g_ptr_array_sized_new (n_names + 1 /* NULL terminator */);
for (i = 0; i < n_names; i++)
if (names[i] != NULL)
g_ptr_array_add (fixed_names, names[i]);