diff options
author | Ted Yin <[email protected]> | 2015-07-02 16:46:17 +0800 |
---|---|---|
committer | Ted Yin <[email protected]> | 2015-07-02 16:46:17 +0800 |
commit | 375f7c6e90d30d332178f0da18700991b2a44fff (patch) | |
tree | bd2cea056e1d594816a98167da445e4d248ae037 | |
parent | 4fec19ba032edee50d62e3ccbf436e3b0ba9f2ee (diff) | |
parent | fabb15fec6e9f4ddd20fe46234201164d3aa8dbb (diff) |
Merge pull request #35 from cloudygoose/master
fix memory leak: matrix not freed when the ref count is greater than zero
-rw-r--r-- | nerv/lib/matrix/generic/matrix.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nerv/lib/matrix/generic/matrix.c b/nerv/lib/matrix/generic/matrix.c index 5dbad48..e4afa37 100644 --- a/nerv/lib/matrix/generic/matrix.c +++ b/nerv/lib/matrix/generic/matrix.c @@ -12,7 +12,10 @@ static void nerv_matrix_(data_free)(Matrix *self, Status *status) { free(self->data_ref); free(self); } - else NERV_SET_STATUS(status, NERV_NORMAL, 0); + else { + free(self); + NERV_SET_STATUS(status, NERV_NORMAL, 0); + } } static void nerv_matrix_(data_retain)(Matrix *self) { |