Ignore:
Timestamp:
2015-10-09T02:41:01Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
b87e5dc
Parents:
c4e61db
git-author:
dequis <dx@…> (08-10-15 07:48:06)
git-committer:
dequis <dx@…> (09-10-15 02:41:01)
Message:

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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_lib.c

    rc4e61db rbbff22d  
    312312        td = ic->proto_data;
    313313
     314        // Parse the data.
     315        if (!(parsed = twitter_parse_response(ic, req))) {
     316                return;
     317        }
     318
    314319        txl = g_new0(struct twitter_xml_list, 1);
    315320        txl->list = td->follow_ids;
    316 
    317         // Parse the data.
    318         if (!(parsed = twitter_parse_response(ic, req))) {
    319                 return;
    320         }
    321321
    322322        twitter_xt_get_friends_id_list(parsed, txl);
     
    388388        }
    389389
     390        // Get the user list from the parsed xml feed.
     391        if (!(parsed = twitter_parse_response(ic, req))) {
     392                return;
     393        }
     394
    390395        txl = g_new0(struct twitter_xml_list, 1);
    391396        txl->list = NULL;
    392397
    393         // Get the user list from the parsed xml feed.
    394         if (!(parsed = twitter_parse_response(ic, req))) {
    395                 return;
    396         }
    397398        twitter_xt_get_users(parsed, txl);
    398399        json_value_free(parsed);
     
    13851386        td = ic->proto_data;
    13861387
    1387         txl = g_new0(struct twitter_xml_list, 1);
    1388         txl->list = NULL;
    1389 
    13901388        // The root <statuses> node should hold the list of statuses <status>
    13911389        if (!(parsed = twitter_parse_response(ic, req))) {
    13921390                goto end;
    13931391        }
     1392
     1393        txl = g_new0(struct twitter_xml_list, 1);
     1394        txl->list = NULL;
     1395
    13941396        twitter_xt_get_status_list(ic, parsed, txl);
    13951397        json_value_free(parsed);
     
    14241426        td = ic->proto_data;
    14251427
    1426         txl = g_new0(struct twitter_xml_list, 1);
    1427         txl->list = NULL;
    1428 
    14291428        // The root <statuses> node should hold the list of statuses <status>
    14301429        if (!(parsed = twitter_parse_response(ic, req))) {
    14311430                goto end;
    14321431        }
     1432
     1433        txl = g_new0(struct twitter_xml_list, 1);
     1434        txl->list = NULL;
     1435
    14331436        twitter_xt_get_status_list(ic, parsed, txl);
    14341437        json_value_free(parsed);
Note: See TracChangeset for help on using the changeset viewer.