From 252e7dfa848bd78a72f6bcad98816b5e2d26b168 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 10 Jun 2005 05:33:58 +0000 Subject: [PATCH] Pass the correct size to realloc(). Fixes 2005-06-10 Federico Mena Quintero * xdgmime.c (xdg_mime_init_from_directory): Pass the correct size to realloc(). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=3506. --- gtk/xdgmime/ChangeLog | 5 +++++ gtk/xdgmime/xdgmime.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk/xdgmime/ChangeLog b/gtk/xdgmime/ChangeLog index 0818220641..9b5b5615f5 100644 --- a/gtk/xdgmime/ChangeLog +++ b/gtk/xdgmime/ChangeLog @@ -1,3 +1,8 @@ +2005-06-10 Federico Mena Quintero + + * xdgmime.c (xdg_mime_init_from_directory): Pass the correct size + to realloc(). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=3506. + 2005-06-09 Matthias Clasen * xdgmimemagic.c: Don't declare errno, including errno.h diff --git a/gtk/xdgmime/xdgmime.c b/gtk/xdgmime/xdgmime.c index 6b400d9ebd..c4bd017adc 100644 --- a/gtk/xdgmime/xdgmime.c +++ b/gtk/xdgmime/xdgmime.c @@ -140,7 +140,7 @@ xdg_mime_init_from_directory (const char *directory) list->next = dir_time_list; dir_time_list = list; - caches = realloc (caches, n_caches + 1); + caches = realloc (caches, sizeof (XdgMimeCache *) * (n_caches + 1)); caches[n_caches] = cache; n_caches++;