[json-glib/json-glib-0-14] parser: Fix small leak in	json_parse_statement
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [json-glib/json-glib-0-14] parser: Fix small leak in	json_parse_statement
- Date: Thu, 25 Oct 2012 15:15:37 +0000 (UTC)
commit 89733b9f31e827cc7468dd476ccb6cf34f86f133
Author: Miguel Angel Cabrera Moya <madmac2501 gmail com>
Date:   Sun Oct 14 12:18:30 2012 +0200
    parser: Fix small leak in json_parse_statement
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686096
    (cherry picked from commit 1d236453b2569cb2cb5bbc80fde1c72e7a101826)
    
    Signed-off-by: Emmanuele Bassi <ebassi gnome org>
 json-glib/json-parser.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/json-glib/json-parser.c b/json-glib/json-parser.c
index 526e2de..55da6fb 100644
--- a/json-glib/json-parser.c
+++ b/json-glib/json-parser.c
@@ -760,7 +760,10 @@ json_parse_statement (JsonParser  *parser,
         /* ... and finally swallow the '=' */
         next_token = json_scanner_get_next_token (scanner);
         if (next_token != '=')
-          return '=';
+          {
+            g_free (name);
+            return '=';
+          }
 
         priv->has_assignment = TRUE;
         priv->variable_name = name;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]