summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-07-16 15:32:32 -0400
committerRyan Lortie <desrt@desrt.ca>2012-07-16 15:32:32 -0400
commitb344256833f07f897235ce3405a0b2589ab7b518 (patch)
tree9cc3c5a5cba026e9e98f25e7a03d2bad4745f8d6
parentbc5343b4e711cc30617db7c7aea71d0a5e7d6c09 (diff)
downloaddconf-b344256833f07f897235ce3405a0b2589ab7b518.tar.gz
dbus1/: fix malloc() off-by-one error
Make sure we allocate enough room for the NULL at the end of the gchar**.
-rw-r--r--dbus-1/dconf-dbus-1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dbus-1/dconf-dbus-1.c b/dbus-1/dconf-dbus-1.c
index 9bf39ff..500700d 100644
--- a/dbus-1/dconf-dbus-1.c
+++ b/dbus-1/dconf-dbus-1.c
@@ -53,7 +53,7 @@ dconf_engine_change_notify (DConfEngine *engine,
gint i;
n_changes = g_strv_length ((gchar **) changes);
- my_changes = g_new (gchar *, n_changes);
+ my_changes = g_new (gchar *, n_changes + 1);
for (i = 0; i < n_changes; i++)
my_changes[i] = g_strconcat (prefix, changes[i], NULL);