From 9ce8d9a6200f36878afea83fd42d341384781f94 Mon Sep 17 00:00:00 2001 From: Bart Kessels Date: Tue, 23 Jan 2018 16:54:28 +0100 Subject: [PATCH] Add missing free for json_error in response stack --- src/getit-content-response.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/getit-content-response.c b/src/getit-content-response.c index 74cb298..a419823 100644 --- a/src/getit-content-response.c +++ b/src/getit-content-response.c @@ -113,7 +113,7 @@ getit_content_response_show_response (GetitContentResponse *self, GtkTextBuffer *text_buffer_pretty; GtkTextBuffer *text_buffer_raw; const gchar *mimetype; - GError *json_error; + GError *json_error = NULL; JsonParser *json_parser; GString *string_response; GBytes *bytes_response; @@ -180,6 +180,8 @@ getit_content_response_show_response (GetitContentResponse *self, pretty_json = json_generator_to_data (json_generator, NULL); gtk_text_buffer_set_text (text_buffer_pretty, pretty_json, strlen(pretty_json)); + } else { + g_error_free (json_error); } /* Load webview */