[totem-pl-parser] videosite: Fix small memory leak



commit 5241e7b125a4c4bc5d24b341754f5bb2b918c3e4
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Jul 3 19:37:40 2017 +0200

    videosite: Fix small memory leak
    
    When checking for videosite support.

 plparse/totem-pl-parser-videosite.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plparse/totem-pl-parser-videosite.c b/plparse/totem-pl-parser-videosite.c
index 90a40e2..096786c 100644
--- a/plparse/totem-pl-parser-videosite.c
+++ b/plparse/totem-pl-parser-videosite.c
@@ -81,12 +81,13 @@ totem_pl_parser_is_videosite (const char *uri, gboolean debug)
        };
        char *out;
        char *script;
+       gboolean ret = FALSE;
 
        script = find_helper_script ();
        if (script == NULL) {
                if (debug)
                        g_print ("Did not find a script to check whether '%s' is a videosite\n", uri);
-               return FALSE;
+               return ret;
        }
 
        args[0] = script;
@@ -101,13 +102,16 @@ totem_pl_parser_is_videosite (const char *uri, gboolean debug)
                      NULL,
                      NULL,
                      NULL);
+
+       ret = g_strcmp0 (out, "TRUE") == 0;
        if (debug)
                g_print ("Checking videosite with script '%s' for URI '%s' returned '%s' (%s)\n",
-                        script, uri, out, g_strcmp0 (out, "TRUE") == 0 ? "true" : "false");
+                        script, uri, out, ret ? "true" : "false");
 
        g_free (script);
+       g_free (out);
 
-       return (g_strcmp0 (out, "TRUE") == 0);
+       return ret;
 }
 
 #ifndef TOTEM_PL_PARSER_MINI


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]