[notification-daemon] nd-bubble.c: Free memory returned by g_find_program_in_path()
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [notification-daemon] nd-bubble.c: Free memory returned by g_find_program_in_path()
- Date: Fri, 20 Mar 2015 12:53:04 +0000 (UTC)
commit 8ad614cfb9ab3d063f0e50b05947aabf67d8d017
Author: Dmitry Shachnev <mitya57 gmail com>
Date: Fri Mar 20 13:25:13 2015 +0300
nd-bubble.c: Free memory returned by g_find_program_in_path()
src/nd-bubble.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/nd-bubble.c b/src/nd-bubble.c
index 31ce126..47efebf 100644
--- a/src/nd-bubble.c
+++ b/src/nd-bubble.c
@@ -473,23 +473,25 @@ on_activate_link (GtkLabel *label,
{
char *escaped_uri;
char *cmd = NULL;
+ char *found = NULL;
/* Somewhat of a hack.. */
bubble->priv->url_clicked_lock = TRUE;
escaped_uri = g_shell_quote (uri);
- if (g_find_program_in_path ("gvfs-open") != NULL) {
+ if ((found = g_find_program_in_path ("gvfs-open")) != NULL) {
cmd = g_strdup_printf ("gvfs-open %s", escaped_uri);
- } else if (g_find_program_in_path ("xdg-open") != NULL) {
+ } else if ((found = g_find_program_in_path ("xdg-open")) != NULL) {
cmd = g_strdup_printf ("xdg-open %s", escaped_uri);
- } else if (g_find_program_in_path ("firefox") != NULL) {
+ } else if ((found = g_find_program_in_path ("firefox")) != NULL) {
cmd = g_strdup_printf ("firefox %s", escaped_uri);
} else {
g_warning ("Unable to find a browser.");
}
g_free (escaped_uri);
+ g_free (found);
if (cmd != NULL) {
g_spawn_command_line_async (cmd, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]