summaryrefslogtreecommitdiff
path: root/json-glib/json-parser.c
diff options
context:
space:
mode:
authorMiguel Angel Cabrera Moya <madmac2501@gmail.com>2012-10-14 12:18:30 +0200
committerEmmanuele Bassi <ebassi@gnome.org>2012-10-25 16:03:58 +0100
commit1d236453b2569cb2cb5bbc80fde1c72e7a101826 (patch)
treeee8b1cbc72075b97225f67834cef55f7cb15a265 /json-glib/json-parser.c
parent626908526f9766e4f612bb4b893b83b7084766dc (diff)
downloadjson-glib-1d236453b2569cb2cb5bbc80fde1c72e7a101826.tar.gz
parser: Fix small leak in json_parse_statement
https://bugzilla.gnome.org/show_bug.cgi?id=686096
Diffstat (limited to 'json-glib/json-parser.c')
-rw-r--r--json-glib/json-parser.c5
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;