diff options
author | dequis <dx@dxzone.com.ar> | 2015-10-08 04:48:06 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-10-08 23:41:01 -0300 |
commit | bbff22d5c2f3a7cef28bd57c7a73379b0c5d2623 (patch) | |
tree | f2141e656c810378a80e13db510eaded4a3b346f /protocols/twitter/twitter_http.c | |
parent | c4e61db186c2e0916e43a1ffc85afe5997aaf345 (diff) |
twitter: Fix some nitpicky issues reported by coverity
Mostly minor rare leaks that happen in error conditions, and one
dereference before null check in twitter_logout (the null check is
probably the wrong one there, but it doesn't hurt to keep it)
Diffstat (limited to 'protocols/twitter/twitter_http.c')
-rw-r--r-- | protocols/twitter/twitter_http.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/protocols/twitter/twitter_http.c b/protocols/twitter/twitter_http.c index 2632f333..c06cac39 100644 --- a/protocols/twitter/twitter_http.c +++ b/protocols/twitter/twitter_http.c @@ -52,7 +52,7 @@ struct http_request *twitter_http(struct im_connection *ic, char *url_string, ht struct twitter_data *td = ic->proto_data; char *tmp; GString *request = g_string_new(""); - void *ret; + void *ret = NULL; char *url_arguments; url_t *base_url = NULL; @@ -71,8 +71,7 @@ struct http_request *twitter_http(struct im_connection *ic, char *url_string, ht if (strstr(url_string, "://")) { base_url = g_new0(url_t, 1); if (!url_set(base_url, url_string)) { - g_free(base_url); - return NULL; + goto error; } } @@ -131,6 +130,7 @@ struct http_request *twitter_http(struct im_connection *ic, char *url_string, ht ret = http_dorequest(td->url_host, td->url_port, td->url_ssl, request->str, func, data); } +error: g_free(url_arguments); g_string_free(request, TRUE); g_free(base_url); |