mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-18 21:54:17 +00:00
Fix a memory leak
This commit is contained in:
+13
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user