From: Mats F. <ma...@us...> - 2001-06-19 08:38:30
|
The following file was modified in apps/bluetooth/sdp_server: Name Old version New version Comment ---- ----------- ----------- ------- sdp_server.c 1.28 1.29=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Should not free rec_hdl_list, since it is declared as static The diff of the modified file(s): --- sdp_server.c 2001/06/14 10:30:42 1.28 +++ sdp_server.c 2001/06/19 08:19:37 1.29 @@ -422,8 +422,8 @@ rec_hdl_list_out[cnt_out] =3D rec_hdl_list_in[i]; D_RHDL(__FUNCTION__": Found record_handle 0x%08x", rec_hdl_list_out[cnt_o= ut]); cnt_out++; - existing =3D FALSE; } + existing =3D FALSE; } =20 rec_hdl_list_out[cnt_out] =3D NO_REC_HDL; @@ -1473,23 +1473,23 @@ =20 rec_hdl_list =3D get_all_rec_hdl(db_hdl->service_class_list, db_hdl->ser= vice_class_cnt); =20=20=20 + D_REC("Got a record handle list"); +=20=20 if (is_err()) - { - if (rec_hdl_list) { - D_MEM("<--- free%d 0x%8p", --malloc_dbg, rec_hdl_list); - free(rec_hdl_list); - } + D_REC("Error occured, sending error response"); send_error_rsp(&db_hdl->db, get_err()); return; } =20 if (rec_hdl_list) { + rec_hdl_cnt =3D 0; while (rec_hdl_list[rec_hdl_cnt] !=3D NO_REC_HDL) { rec_hdl_cnt++; } + D_REC("Found %d record handles", rec_hdl_cnt); } =20=20=20 /* Skip the sdp header and the attribute byte count field */ @@ -1525,11 +1525,6 @@ } else if (is_err()) { - if (rec_hdl_list) - { - D_MEM("<--- free%d 0x%8p", --malloc_dbg, rec_hdl_list); - free(rec_hdl_list); - } send_error_rsp(&db_hdl->db, get_err()); return; } @@ -1540,11 +1535,6 @@ rsp_pkt[rsp_pkt_len + 1] =3D tmp_len - 2; rsp_pkt_len +=3D tmp_len; } - } - if (rec_hdl_list) - { - D_MEM("<--- free%d 0x%8p", --malloc_dbg, rec_hdl_list); - free(rec_hdl_list); } =20 /* Set the attribute byte count to packet length minus sdp pdu header si= ze |