Fixed memory leak in custom uri handler.
authorDaniel Carl <danielcarl@gmx.de>
Wed, 28 May 2014 10:45:35 +0000 (12:45 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Wed, 28 May 2014 10:45:35 +0000 (12:45 +0200)
Added also some warning message if the handler could not be called.

src/handlers.c

index 2aed472..0aacac3 100644 (file)
@@ -63,6 +63,8 @@ gboolean handle_uri(const char *uri)
     GError *error = NULL;
     char *cmd = g_strdup_printf(handler, uri);
     if (!g_spawn_command_line_async(cmd, &error)) {
+        g_warning("Can't run '%s': %s", cmd, error->message);
+        g_clear_error(&error);
         return false;
     }