Project

General

Profile

Feature #4461 » 0004-hdhomerun-Fix-memory-leak-of-access_t.patch

Em Smith, 2020-06-12 01:18

View differences:

src/webui/webui.c
1619 1619
  /* We generate a unique deviceid based on the server name */
1620 1620
  uint32_t deviceid = tvh_crc32((const uint8_t*)server_name, strlen(server_name), 0);
1621 1621

  
1622
  if (access_verify2(perm, ACCESS_STREAMING))
1623
       return http_noaccess_code(hc);
1622
  if (access_verify2(perm, ACCESS_STREAMING)) {
1623
    access_destroy(perm);
1624
    return http_noaccess_code(hc);
1625
  }
1624 1626

  
1625 1627
  hq = &hc->hc_reply;
1626 1628
  tcp_get_str_from_ip(hc->hc_self, http_ip, sizeof(http_ip));
......
1643 1645
                 deviceid,
1644 1646
                 http_ip, tvheadend_webui_port);
1645 1647
  http_output_content(hc, "application/json");
1648
  access_destroy(perm);
1646 1649
  return 0;
1647 1650
}
1648 1651

  
......
1681 1684
    (config.chname_src ? CHANNEL_ENAME_SOURCES : 0);
1682 1685
  int is_first = 1;
1683 1686

  
1684
  if (access_verify2(perm, ACCESS_STREAMING))
1687
  if (access_verify2(perm, ACCESS_STREAMING)) {
1688
    access_destroy(perm);
1685 1689
    return http_noaccess_code(hc);
1690
  }
1686 1691

  
1687 1692
  tcp_get_str_from_ip(hc->hc_self, http_ip, sizeof(http_ip));
1688 1693
  blank = tvh_gettext_lang(perm->aa_lang_ui, channel_blank_name);
......
1715 1720
  tvh_mutex_unlock(&global_lock);
1716 1721
  htsbuf_append_str(hq, "]");
1717 1722
  http_output_content(hc, "application/json");
1723
  access_destroy(perm);
1718 1724
  return 0;
1719 1725
}
1720 1726

  
1721
- 
(8-8/19)