popmedia: NULL dereferencing prevented in error path.

Summary:
If the execution of _popmedia flows in the goto error path, then the
 term pointer member might not assigned and reference counted. However
 _ty_http_head_delete and term_unref unconditionaly deference it, resulting
 in a NULL access.
 This patch add guards to prevent the dereference of the term pointer
 in _ty_http_head_delete.

Reviewers: billiob

Reviewed By: billiob

Subscribers: billiob

Differential Revision: https://phab.enlightenment.org/D5865
This commit is contained in:
Benjamin Jacobs 2018-04-05 22:28:27 +02:00 committed by Boris Faure
parent 0f24619dfa
commit e55fd61208
1 changed files with 5 additions and 2 deletions

View File

@ -4052,8 +4052,11 @@ _ty_http_head_delete(Ty_Http_Head *ty_head)
eina_stringshare_del(ty_head->src);
ecore_con_url_free(ty_head->url);
ecore_event_handler_del(ty_head->url_complete);
edje_object_signal_emit(ty_head->term->bg, "done", "terminology");
term_unref(ty_head->term);
if (ty_head->term)
{
edje_object_signal_emit(ty_head->term->bg, "done", "terminology");
term_unref(ty_head->term);
}
ecore_timer_del(ty_head->timeout);
free(ty_head);