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_lib.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_lib.c')
| -rw-r--r-- | protocols/twitter/twitter_lib.c | 27 | 
1 files changed, 15 insertions, 12 deletions
| diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index 40adb992..80747015 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -311,14 +311,14 @@ static void twitter_http_get_friends_ids(struct http_request *req)  	td = ic->proto_data; -	txl = g_new0(struct twitter_xml_list, 1); -	txl->list = td->follow_ids; -  	// Parse the data.  	if (!(parsed = twitter_parse_response(ic, req))) {  		return;  	} +	txl = g_new0(struct twitter_xml_list, 1); +	txl->list = td->follow_ids; +  	twitter_xt_get_friends_id_list(parsed, txl);  	json_value_free(parsed); @@ -387,13 +387,14 @@ static void twitter_http_get_users_lookup(struct http_request *req)  		return;  	} -	txl = g_new0(struct twitter_xml_list, 1); -	txl->list = NULL; -  	// Get the user list from the parsed xml feed.  	if (!(parsed = twitter_parse_response(ic, req))) {  		return;  	} + +	txl = g_new0(struct twitter_xml_list, 1); +	txl->list = NULL; +  	twitter_xt_get_users(parsed, txl);  	json_value_free(parsed); @@ -1384,13 +1385,14 @@ static void twitter_http_get_home_timeline(struct http_request *req)  	td = ic->proto_data; -	txl = g_new0(struct twitter_xml_list, 1); -	txl->list = NULL; -  	// The root <statuses> node should hold the list of statuses <status>  	if (!(parsed = twitter_parse_response(ic, req))) {  		goto end;  	} + +	txl = g_new0(struct twitter_xml_list, 1); +	txl->list = NULL; +  	twitter_xt_get_status_list(ic, parsed, txl);  	json_value_free(parsed); @@ -1423,13 +1425,14 @@ static void twitter_http_get_mentions(struct http_request *req)  	td = ic->proto_data; -	txl = g_new0(struct twitter_xml_list, 1); -	txl->list = NULL; -  	// The root <statuses> node should hold the list of statuses <status>  	if (!(parsed = twitter_parse_response(ic, req))) {  		goto end;  	} + +	txl = g_new0(struct twitter_xml_list, 1); +	txl->list = NULL; +  	twitter_xt_get_status_list(ic, parsed, txl);  	json_value_free(parsed); | 
