From 6e4e25035b08f24b30ec7c0f696f0b7c812e367e Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 23 Jan 2008 11:57:14 +0000 Subject: [PATCH] gracefully handle a NULL link. (mru_destruct): plugged a memory leak. 2008-01-23 Sven Neumann * plug-ins/imagemap/imap_mru.c (mru_remove_link): gracefully handle a NULL link. (mru_destruct): plugged a memory leak. * plug-ins/imagemap/imap_about.c: use "program-name" instead of "name". svn path=/trunk/; revision=24686 --- ChangeLog | 9 +++++++++ plug-ins/imagemap/imap_about.c | 2 +- plug-ins/imagemap/imap_mru.c | 8 ++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 259605a196..3047b33687 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-01-23 Sven Neumann + + * plug-ins/imagemap/imap_mru.c (mru_remove_link): gracefully + handle a NULL link. + (mru_destruct): plugged a memory leak. + + * plug-ins/imagemap/imap_about.c: use "program-name" instead + of "name". + 2008-01-23 Michael Natterer * app/tools/gimpimagemaptool.h: don't #include diff --git a/plug-ins/imagemap/imap_about.c b/plug-ins/imagemap/imap_about.c index b61bc5b8ab..b1673b1af8 100644 --- a/plug-ins/imagemap/imap_about.c +++ b/plug-ins/imagemap/imap_about.c @@ -40,7 +40,7 @@ do_about_dialog(void) dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG, "transient-for", get_dialog(), - "name", _("Image Map Plug-In"), + "program-name", _("Image Map Plug-In"), "version", "2.3", "authors", authors, "copyright", diff --git a/plug-ins/imagemap/imap_mru.c b/plug-ins/imagemap/imap_mru.c index daa33f49df..d8b91d3c97 100644 --- a/plug-ins/imagemap/imap_mru.c +++ b/plug-ins/imagemap/imap_mru.c @@ -42,14 +42,18 @@ void mru_destruct(MRU_t *mru) { g_list_foreach(mru->list, (GFunc) g_free, NULL); + g_list_free (mru->list); g_free(mru); } static void mru_remove_link(MRU_t *mru, GList *link) { - g_free(link->data); - mru->list = g_list_remove_link(mru->list, link); + if (link) + { + g_free(link->data); + mru->list = g_list_remove_link(mru->list, link); + } } static GList*