Skip to content

Commit

Permalink
Merge pull request #4945 from cindytsai/Fix-MemLeak
Browse files Browse the repository at this point in the history
Fix memory leakage
  • Loading branch information
chrishavlin authored Jul 19, 2024
2 parents 874cb3f + b93701e commit a093170
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yt/utilities/lib/quad_tree.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,6 @@ cdef class QuadTree:
np.float64_t wtoadd,
np.int64_t level):
cdef int i, j, n
cdef np.float64_t *vorig
vorig = <np.float64_t *> malloc(sizeof(np.float64_t) * self.nvals)
if node.children[0][0] == NULL:
if self.merged == -1:
for i in range(self.nvals):
Expand All @@ -432,6 +430,8 @@ cdef class QuadTree:
iy[curpos] = node.pos[1]
return 1
cdef np.int64_t added = 0
cdef np.float64_t *vorig
vorig = <np.float64_t *> malloc(sizeof(np.float64_t) * self.nvals)
if self.merged == 1:
for i in range(self.nvals):
vorig[i] = vtoadd[i]
Expand Down

0 comments on commit a093170

Please sign in to comment.