Fix a memory leak

This commit is contained in:
Max Lv
2017-02-17 12:31:22 +08:00
parent 97ac602dbf
commit d434cd20ec
8 changed files with 32 additions and 24 deletions
+13
View File
@@ -229,6 +229,19 @@ ss_malloc(size_t size)
return tmp;
}
void *
ss_align(size_t size)
{
int err;
void *tmp;
err = posix_memalign(&tmp, sizeof(void *), size);
if (err) {
return ss_malloc(size);
} else {
return tmp;
}
}
void *
ss_realloc(void *ptr, size_t new_size)
{