Skip to content

Commit

Permalink
Fixed crash related to recent change in Atom::copy() and data_.
Browse files Browse the repository at this point in the history
  • Loading branch information
trisyoungs committed Feb 16, 2018
1 parent c12cecd commit 9743361
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/base/atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ void Atom::setData(const char* data)
// Delete any old data and set new
if (data_ != NULL) delete[] data_;
data_ = NULL;
if (data == NULL) return;

// Now copy data
int len = strlen(data);
if (len == 0) return;
data_ = new char[len+1];
Expand Down

0 comments on commit 9743361

Please sign in to comment.