mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #515, use srs_freepa to free the array.
This commit is contained in:
parent
ef00005ab4
commit
2af7749771
16 changed files with 69 additions and 64 deletions
|
@ -205,7 +205,7 @@ int SrsDynamicHttpConn::do_proxy(ISrsHttpResponseReader* rr, SrsFlvDecoder* dec)
|
|||
|
||||
char* data = new char[size];
|
||||
if ((ret = dec->read_tag_data(data, size)) != ERROR_SUCCESS) {
|
||||
srs_freep(data);
|
||||
srs_freepa(data);
|
||||
if (!srs_is_client_gracefully_close(ret)) {
|
||||
srs_error("flv: proxy tag data failed. ret=%d", ret);
|
||||
}
|
||||
|
|
|
@ -433,7 +433,7 @@ int SrsConfDirective::read_token(SrsConfigBuffer* buffer, vector<string>& args,
|
|||
if (!word_str.empty()) {
|
||||
args.push_back(word_str);
|
||||
}
|
||||
srs_freep(aword);
|
||||
srs_freepa(aword);
|
||||
|
||||
if (ch == ';') {
|
||||
return ERROR_SYSTEM_CONFIG_DIRECTIVE;
|
||||
|
@ -4488,7 +4488,7 @@ namespace _srs_internal
|
|||
|
||||
SrsConfigBuffer::~SrsConfigBuffer()
|
||||
{
|
||||
srs_freep(start);
|
||||
srs_freepa(start);
|
||||
}
|
||||
|
||||
int SrsConfigBuffer::fullfill(const char* filename)
|
||||
|
@ -4507,7 +4507,7 @@ namespace _srs_internal
|
|||
int filesize = (int)reader.filesize();
|
||||
|
||||
// create buffer
|
||||
srs_freep(start);
|
||||
srs_freepa(start);
|
||||
pos = last = start = new char[filesize];
|
||||
end = start + filesize;
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ SrsHttpResponseWriter::SrsHttpResponseWriter(SrsStSocket* io)
|
|||
SrsHttpResponseWriter::~SrsHttpResponseWriter()
|
||||
{
|
||||
srs_freep(hdr);
|
||||
srs_freep(iovss_cache);
|
||||
srs_freepa(iovss_cache);
|
||||
}
|
||||
|
||||
int SrsHttpResponseWriter::final_request()
|
||||
|
@ -188,7 +188,7 @@ int SrsHttpResponseWriter::writev(iovec* iov, int iovcnt, ssize_t* pnwrite)
|
|||
int nb_iovss = 3 + iovcnt;
|
||||
iovec* iovss = iovss_cache;
|
||||
if (nb_iovss_cache < nb_iovss) {
|
||||
srs_freep(iovss_cache);
|
||||
srs_freepa(iovss_cache);
|
||||
nb_iovss_cache = nb_iovss;
|
||||
iovss = iovss_cache = new iovec[nb_iovss];
|
||||
}
|
||||
|
@ -506,7 +506,7 @@ SrsHttpMessage::~SrsHttpMessage()
|
|||
{
|
||||
srs_freep(_body);
|
||||
srs_freep(_uri);
|
||||
srs_freep(_http_ts_send_buffer);
|
||||
srs_freepa(_http_ts_send_buffer);
|
||||
}
|
||||
|
||||
int SrsHttpMessage::update(string url, http_parser* header, SrsFastBuffer* body, vector<SrsHttpHeaderField>& headers)
|
||||
|
|
|
@ -94,7 +94,7 @@ SrsUdpListener::~SrsUdpListener()
|
|||
// close it manually.
|
||||
close(_fd);
|
||||
|
||||
srs_freep(buf);
|
||||
srs_freepa(buf);
|
||||
}
|
||||
|
||||
int SrsUdpListener::fd()
|
||||
|
|
|
@ -91,7 +91,7 @@ SrsFastLog::SrsFastLog()
|
|||
|
||||
SrsFastLog::~SrsFastLog()
|
||||
{
|
||||
srs_freep(log_data);
|
||||
srs_freepa(log_data);
|
||||
|
||||
if (fd > 0) {
|
||||
::close(fd);
|
||||
|
|
|
@ -161,7 +161,7 @@ SrsFastVector::SrsFastVector()
|
|||
SrsFastVector::~SrsFastVector()
|
||||
{
|
||||
free();
|
||||
srs_freep(msgs);
|
||||
srs_freepa(msgs);
|
||||
}
|
||||
|
||||
int SrsFastVector::size()
|
||||
|
@ -220,7 +220,7 @@ void SrsFastVector::push_back(SrsSharedPtrMessage* msg)
|
|||
srs_warn("fast vector incrase %d=>%d", nb_msgs, size);
|
||||
|
||||
// use new array.
|
||||
srs_freep(msgs);
|
||||
srs_freepa(msgs);
|
||||
msgs = buf;
|
||||
nb_msgs = size;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue