Skip to content

Commit

Permalink
Merge pull request rogersce#10 from rjw57/fix-memory-leak
Browse files Browse the repository at this point in the history
cnpy.cpp: fix memory leak in parsing shape field
  • Loading branch information
rogersce committed Feb 17, 2015
2 parents 013d31d + e210e16 commit 814b38e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cnpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ cnpy::NpyArray load_the_npy_file(FILE* fp) {
cnpy::NpyArray arr;
arr.word_size = word_size;
arr.shape = std::vector<unsigned int>(shape,shape+ndims);
delete[] shape;
arr.data = new char[size*word_size];
arr.fortran_order = fortran_order;
size_t nread = fread(arr.data,word_size,size,fp);
Expand Down

0 comments on commit 814b38e

Please sign in to comment.