commit a300f65525e509204fd133292badb6836b32dc11
parent 44fff45e2c28ef5fb224abd0b344edb18e2a4f98
Author: Michael Rasmussen <mir@datanom.net>
Date: Wed, 30 Jan 2019 00:29:12 +0100
Fix possible memory leak
Signed-off-by: Michael Rasmussen <mir@datanom.net>
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/plugins/litehtml_viewer/http.cpp b/src/plugins/litehtml_viewer/http.cpp
@@ -70,11 +70,11 @@ GInputStream *http::load_url(const gchar *url, GError **error)
} else {
struct Data data;
- data.memory = g_memory_input_stream_new();
- data.size = 0;
-
if (!curl) return NULL;
+ data.memory = g_memory_input_stream_new();
+ data.size = 0;
+
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&data);
res = curl_easy_perform(curl);