From: <rl...@us...> - 2006-09-26 17:38:16
|
Revision: 17356 http://svn.sourceforge.net/gaim/?rev=17356&view=rev Author: rlaager Date: 2006-09-26 10:38:09 -0700 (Tue, 26 Sep 2006) Log Message: ----------- After the comments on gaim-devel about 'bad' code, I looked into the function referenced. It appears that yahoo_buddy_icon_upload_connected() is only called as a callback. It's registered from yahoo_buddy_icon_upload(). yahoo_buddy_icon_upload() is only called twice. In neither case can a NULL make it down to yahoo_buddy_icon_upload_connected(). As this is an exceptional case rather than a normal one, a g_return_if_fail() is more appropriate. That adds logging, makes the intent clearer, and will help the Coverity software detect violations of this assumption. Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo_picture.c Modified: trunk/libgaim/protocols/yahoo/yahoo_picture.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_picture.c 2006-09-26 17:24:45 UTC (rev 17355) +++ trunk/libgaim/protocols/yahoo/yahoo_picture.c 2006-09-26 17:38:09 UTC (rev 17356) @@ -438,8 +438,7 @@ GaimAccount *account; struct yahoo_data *yd; - if (!d) - return; + g_return_if_fail(d != NULL); gc = d->gc; account = gaim_connection_get_account(gc); @@ -500,6 +499,8 @@ GaimAccount *account = gaim_connection_get_account(gc); struct yahoo_data *yd = gc->proto_data; + g_return_if_fail(d != NULL); + if (yd->jp) { if (gaim_proxy_connect(account, gaim_account_get_string(account, "xferjp_host", YAHOOJP_XFER_HOST), gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |