Mercurial > pidgin.yaz
comparison libgaim/protocols/jabber/oob.c @ 15284: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 | ba12c5e9d7e7 |
children |
comparison
equal
deleted
inserted
replaced
15283:8e39ca9b954a | 15284:c2f15e2117dc |
---|---|
213 jox->headers = g_string_new(""); | 213 jox->headers = g_string_new(""); |
214 jox->iq_id = g_strdup(xmlnode_get_attrib(packet, "id")); | 214 jox->iq_id = g_strdup(xmlnode_get_attrib(packet, "id")); |
215 | 215 |
216 xfer = gaim_xfer_new(js->gc->account, GAIM_XFER_RECEIVE, | 216 xfer = gaim_xfer_new(js->gc->account, GAIM_XFER_RECEIVE, |
217 xmlnode_get_attrib(packet, "from")); | 217 xmlnode_get_attrib(packet, "from")); |
218 xfer->data = jox; | 218 if (xfer) |
219 | 219 { |
220 if(!(filename = g_strdup(g_strrstr(jox->page, "/")))) | 220 xfer->data = jox; |
221 filename = g_strdup(jox->page); | 221 |
222 | 222 if(!(filename = g_strdup(g_strrstr(jox->page, "/")))) |
223 gaim_xfer_set_filename(xfer, filename); | 223 filename = g_strdup(jox->page); |
224 | 224 |
225 g_free(filename); | 225 gaim_xfer_set_filename(xfer, filename); |
226 | 226 |
227 gaim_xfer_set_init_fnc(xfer, jabber_oob_xfer_init); | 227 g_free(filename); |
228 gaim_xfer_set_end_fnc(xfer, jabber_oob_xfer_end); | 228 |
229 gaim_xfer_set_request_denied_fnc(xfer, jabber_oob_xfer_recv_denied); | 229 gaim_xfer_set_init_fnc(xfer, jabber_oob_xfer_init); |
230 gaim_xfer_set_cancel_recv_fnc(xfer, jabber_oob_xfer_recv_canceled); | 230 gaim_xfer_set_end_fnc(xfer, jabber_oob_xfer_end); |
231 gaim_xfer_set_read_fnc(xfer, jabber_oob_xfer_read); | 231 gaim_xfer_set_request_denied_fnc(xfer, jabber_oob_xfer_recv_denied); |
232 gaim_xfer_set_start_fnc(xfer, jabber_oob_xfer_start); | 232 gaim_xfer_set_cancel_recv_fnc(xfer, jabber_oob_xfer_recv_canceled); |
233 | 233 gaim_xfer_set_read_fnc(xfer, jabber_oob_xfer_read); |
234 js->oob_file_transfers = g_list_append(js->oob_file_transfers, xfer); | 234 gaim_xfer_set_start_fnc(xfer, jabber_oob_xfer_start); |
235 | 235 |
236 gaim_xfer_request(xfer); | 236 js->oob_file_transfers = g_list_append(js->oob_file_transfers, xfer); |
237 } | 237 |
238 | 238 gaim_xfer_request(xfer); |
239 | 239 } |
240 } | |
241 | |
242 |