diff options
author | Sjoerd Simons <sjoerd@luon.net> | 2011-10-19 23:26:35 +0100 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2011-10-20 10:24:33 +0200 |
commit | 02afe18bbb7880118bc99ffaeaccdacfbb75a44d (patch) | |
tree | 563a733c981c3f046deb9ecea43b39d19df7e13e /girepository | |
parent | 60d0ec439957b76aff2ed0add44e5a7f9bba69dc (diff) | |
download | gobject-introspection-02afe18bbb7880118bc99ffaeaccdacfbb75a44d.tar.gz |
Use the correct size when freeing unused info
A GIBaseInfo struct can underneath either be GIRealInfo *or*
GIUnresolvedInfo if the type is GI_INFO_TYPE_UNRESOLVED. So when we
eventually free the structures slice use the correct struct type
otherwise things get unhappy.
Diffstat (limited to 'girepository')
-rw-r--r-- | girepository/gibaseinfo.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/girepository/gibaseinfo.c b/girepository/gibaseinfo.c index bfb77436..48af5c21 100644 --- a/girepository/gibaseinfo.c +++ b/girepository/gibaseinfo.c @@ -253,7 +253,10 @@ g_base_info_unref (GIBaseInfo *info) if (rinfo->repository) g_object_unref (rinfo->repository); - g_slice_free (GIRealInfo, rinfo); + if (rinfo->type == GI_INFO_TYPE_UNRESOLVED) + g_slice_free (GIUnresolvedInfo, rinfo); + else + g_slice_free (GIRealInfo, rinfo); } } |