From d239e3a08cf1e6a437976c3f5b3206a30ef33e67 Mon Sep 17 00:00:00 2001 From: Monsta Date: Mon, 3 Nov 2014 15:14:41 +0300 Subject: allocate memory a bit later to avoid possible leaks --- src/eom-plugin-engine.c | 4 ++-- src/eom-uri-converter.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/eom-plugin-engine.c b/src/eom-plugin-engine.c index 11a59ea..5207d95 100644 --- a/src/eom-plugin-engine.c +++ b/src/eom-plugin-engine.c @@ -509,12 +509,12 @@ load_plugin_module (EomPluginInfo *info) return FALSE; } - dir = g_path_get_dirname (info->file); - g_return_val_if_fail ((info->location != NULL) && (info->location[0] != '\0'), FALSE); + dir = g_path_get_dirname (info->file); + info->module = G_TYPE_MODULE ( eom_python_module_new (dir, info->location)); diff --git a/src/eom-uri-converter.c b/src/eom-uri-converter.c index 6382e74..452a19b 100644 --- a/src/eom-uri-converter.c +++ b/src/eom-uri-converter.c @@ -834,8 +834,6 @@ eom_uri_converter_preview (const char *format_str, EomImage *img, GdkPixbufForma n_digits = ceil (MIN (log10 (G_MAXULONG), MAX (log10 (counter), log10 (n_images)))); - str = g_string_new (""); - if (!g_utf8_validate (format_str, -1, NULL)) return NULL; @@ -843,6 +841,8 @@ eom_uri_converter_preview (const char *format_str, EomImage *img, GdkPixbufForma s = format_str; token_next = FALSE; + str = g_string_new (""); + for (i = 0; i < len; i++, s = g_utf8_next_char (s)) { c = g_utf8_get_char (s); -- cgit v1.2.1