fix(c-content): avoid memory leak in sal_body_handler_from_content

This commit is contained in:
Ronan Abhamon 2018-04-25 16:54:43 +02:00
parent 6fcc907636
commit ab47110568

View file

@ -315,6 +315,7 @@ SalBodyHandler *sal_body_handler_from_content (const LinphoneContent *content) {
const char *boundary = L_STRING_TO_C(contentType.getParameter("boundary").getValue());
belle_sip_multipart_body_handler_t *bh = belle_sip_multipart_body_handler_new_from_buffer(buffer, size, boundary);
body_handler = (SalBodyHandler *)BELLE_SIP_BODY_HANDLER(bh);
bctbx_free(buffer);
} else {
body_handler = sal_body_handler_new();
sal_body_handler_set_data(body_handler, belle_sip_strdup(linphone_content_get_string_buffer(content)));