Mercurial > pidgin
comparison libgaim/protocols/qq/send_file.c @ 15283:c2f15e2117dc
[gaim-migrate @ 18073]
gaim_xfer_new() can return NULL via g_return_if_fail(). It should therefore not be assumed that it returns a GaimXfer; check against its return value before proceeding when creating a GaimXfer.
committer: Tailor Script <tailor@pidgin.im>
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Thu, 04 Jan 2007 23:20:12 +0000 |
parents | c039c920e11c |
children |
comparison
equal
deleted
inserted
replaced
15282:8e39ca9b954a | 15283:c2f15e2117dc |
---|---|
839 } | 839 } |
840 | 840 |
841 xfer = gaim_xfer_new(gaim_connection_get_account(gc), | 841 xfer = gaim_xfer_new(gaim_connection_get_account(gc), |
842 GAIM_XFER_RECEIVE, | 842 GAIM_XFER_RECEIVE, |
843 sender_name); | 843 sender_name); |
844 gaim_xfer_set_filename(xfer, fileinfo[0]); | 844 if (xfer) |
845 gaim_xfer_set_size(xfer, atoi(fileinfo[1])); | 845 { |
846 | 846 gaim_xfer_set_filename(xfer, fileinfo[0]); |
847 gaim_xfer_set_init_fnc(xfer, _qq_xfer_recv_init); | 847 gaim_xfer_set_size(xfer, atoi(fileinfo[1])); |
848 gaim_xfer_set_request_denied_fnc(xfer, _qq_xfer_cancel); | 848 |
849 gaim_xfer_set_cancel_recv_fnc(xfer, _qq_xfer_cancel); | 849 gaim_xfer_set_init_fnc(xfer, _qq_xfer_recv_init); |
850 gaim_xfer_set_end_fnc(xfer, _qq_xfer_end); | 850 gaim_xfer_set_request_denied_fnc(xfer, _qq_xfer_cancel); |
851 gaim_xfer_set_write_fnc(xfer, _qq_xfer_write); | 851 gaim_xfer_set_cancel_recv_fnc(xfer, _qq_xfer_cancel); |
852 | 852 gaim_xfer_set_end_fnc(xfer, _qq_xfer_end); |
853 xfer->data = info; | 853 gaim_xfer_set_write_fnc(xfer, _qq_xfer_write); |
854 qd->xfer = xfer; | 854 |
855 | 855 xfer->data = info; |
856 gaim_xfer_request(xfer); | 856 qd->xfer = xfer; |
857 | |
858 gaim_xfer_request(xfer); | |
859 } | |
857 | 860 |
858 g_free(sender_name); | 861 g_free(sender_name); |
859 g_strfreev(fileinfo); | 862 g_strfreev(fileinfo); |
860 } | 863 } |
861 | 864 |
918 | 921 |
919 qd = (qq_data *) gc->proto_data; | 922 qd = (qq_data *) gc->proto_data; |
920 | 923 |
921 xfer = gaim_xfer_new (gc->account, GAIM_XFER_SEND, | 924 xfer = gaim_xfer_new (gc->account, GAIM_XFER_SEND, |
922 who); | 925 who); |
923 gaim_xfer_set_init_fnc (xfer, _qq_xfer_init); | 926 if (xfer) |
924 gaim_xfer_set_cancel_send_fnc (xfer, _qq_xfer_cancel); | 927 { |
925 gaim_xfer_set_write_fnc(xfer, _qq_xfer_write); | 928 gaim_xfer_set_init_fnc (xfer, _qq_xfer_init); |
926 | 929 gaim_xfer_set_cancel_send_fnc (xfer, _qq_xfer_cancel); |
927 qd->xfer = xfer; | 930 gaim_xfer_set_write_fnc(xfer, _qq_xfer_write); |
928 gaim_xfer_request (xfer); | 931 |
932 qd->xfer = xfer; | |
933 gaim_xfer_request(xfer); | |
934 } | |
929 } | 935 } |
930 | 936 |
931 /* | 937 /* |
932 static void qq_send_packet_request_key(GaimConnection *gc, guint8 key) | 938 static void qq_send_packet_request_key(GaimConnection *gc, guint8 key) |
933 { | 939 { |