From b19e5ec32839085cb639d4fbbbe13b1d0526a2f7 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 7 Nov 2005 19:33:31 +0000 Subject: reviewed by: Christian Persch 2005-11-07 Bastien Nocera reviewed by: Christian Persch * plugins/desktop-file/plugin.cpp: Fix memleaks in the usage of g_key_file_get_string(). Fixes bug #320901. --- plugins/desktop-file/plugin.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins/desktop-file/plugin.cpp') diff --git a/plugins/desktop-file/plugin.cpp b/plugins/desktop-file/plugin.cpp index d5efa3ebe..74d51212c 100644 --- a/plugins/desktop-file/plugin.cpp +++ b/plugins/desktop-file/plugin.cpp @@ -223,6 +223,7 @@ plugin_stream_as_file (NPP instance, g_key_file_free (keyfile); return NPERR_GENERIC_ERROR; } + g_free (group); char *encoding = g_key_file_get_string (keyfile, kDesktopEntry, "Encoding", NULL); if (!encoding || strcmp (encoding, "UTF-8") != 0) { @@ -231,6 +232,7 @@ plugin_stream_as_file (NPP instance, g_key_file_free (keyfile); return NPERR_GENERIC_ERROR; } + g_free (encoding); char *type = g_key_file_get_string (keyfile, kDesktopEntry, "Type", NULL); if (!type || strcmp (type, "Link") != 0) { @@ -239,6 +241,7 @@ plugin_stream_as_file (NPP instance, g_key_file_free (keyfile); return NPERR_GENERIC_ERROR; } + g_free (type); char *url = g_key_file_get_string (keyfile, kDesktopEntry, "URL", NULL); if (!url || !url[0]) { -- cgit v1.2.3