summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Gohad <tusharsg@gmail.com>2014-06-27 09:02:41 -0700
committerTushar Gohad <tusharsg@gmail.com>2014-06-27 09:02:41 -0700
commitd23fb9fce55fb1c8063be50b71b2a88de655d14c (patch)
treecc122219174f46571e47bcdfefcf69efa37a239d
parenta5440dac2c02abd588167086045a66a98fb6cd5f (diff)
parent916e6e12703f32bd5cf4fb4f4e1c8838c340facc (diff)
downloadpyeclib-d23fb9fce55fb1c8063be50b71b2a88de655d14c.tar.gz
Merged in issue-52 (pull request #12)
Issue-52: fixed leak in reconstruct path
-rw-r--r--src/c/pyeclib_c/pyeclib_c.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/c/pyeclib_c/pyeclib_c.c b/src/c/pyeclib_c/pyeclib_c.c
index 4607ae7..6827c09 100644
--- a/src/c/pyeclib_c/pyeclib_c.c
+++ b/src/c/pyeclib_c/pyeclib_c.c
@@ -289,7 +289,7 @@ void* alloc_aligned_buffer16(int size)
* 16-byte boundaries to support
* 128-bit operations
*/
- if (posix_memalign(&buf, 16, size) < 0) {
+ if (posix_memalign(&buf, 16, size) != 0) {
return PyErr_NoMemory();
} else {
memset(buf, 0, size);
@@ -1788,6 +1788,7 @@ error:
reconstructed = NULL;
out:
+ free(erased);
/* Free fragment buffers that needed to be reallocated for alignment */
for (i = 0; i < k; i++) {
if (realloc_bm & (1 << i)) {