Skip to content

Commit

Permalink
for #515, use srs_freepa to free array.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Nov 2, 2015
1 parent 8cec06e commit 604486b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions trunk/src/protocol/srs_kafka_stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ SrsKafkaString::SrsKafkaString(string v)

SrsKafkaString::~SrsKafkaString()
{
srs_freep(data);
srs_freepa(data);
}

bool SrsKafkaString::null()
Expand All @@ -80,7 +80,7 @@ string SrsKafkaString::to_str()
void SrsKafkaString::set_value(string v)
{
// free previous data.
srs_freep(data);
srs_freepa(data);

// copy new value to data.
_size = (int16_t)v.length();
Expand Down Expand Up @@ -147,7 +147,7 @@ int SrsKafkaString::decode(SrsBuffer* buf)
return ret;
}

srs_freep(data);
srs_freepa(data);
data = new char[_size];

buf->read_bytes(data, _size);
Expand All @@ -171,7 +171,7 @@ SrsKafkaBytes::SrsKafkaBytes(const char* v, int nb_v)

SrsKafkaBytes::~SrsKafkaBytes()
{
srs_freep(_data);
srs_freepa(_data);
}

char* SrsKafkaBytes::data()
Expand Down Expand Up @@ -202,7 +202,7 @@ void SrsKafkaBytes::set_value(string v)
void SrsKafkaBytes::set_value(const char* v, int nb_v)
{
// free previous data.
srs_freep(_data);
srs_freepa(_data);

// copy new value to data.
_size = (int16_t)nb_v;
Expand Down Expand Up @@ -280,7 +280,7 @@ int SrsKafkaBytes::decode(SrsBuffer* buf)
return ret;
}

srs_freep(_data);
srs_freepa(_data);
_data = new char[_size];
buf->read_bytes(_data, _size);

Expand Down

0 comments on commit 604486b

Please sign in to comment.