GNOME Bugzilla – Bug 686096
Small leak in json_parse_statement
Last modified: 2012-10-25 15:05:14 UTC
Here is the proposed fix: diff --git a/json-glib/json-parser.c b/json-glib/json-parser.c index 526e2de..296c1aa 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 != '=') + { + g_free (name); return '='; + } priv->has_assignment = TRUE; priv->variable_name = name;
Thanks! (Attaching patches as attachments is welcome, so they can be queried for.)
Created attachment 226406 [details] [review] Proposed fix
Could you review/commit the patch? Thanks
Review of attachment 226406 [details] [review]: thanks for the patch; there's one minor coding style issue that has to be fixed before commit. ::: json-glib/json-parser.c @@ +761,3 @@ next_token = json_scanner_get_next_token (scanner); if (next_token != '=') + { conding style: the curly braces should have an additional indentation level.
Created attachment 227041 [details] [review] proposed fix
Review of attachment 227041 [details] [review]: brilliant, thanks a lot!
Could you push the patch?
Pushed to master, thanks!