Skip to content

Commit

Permalink
Correctly free memory allocated by libuv
Browse files Browse the repository at this point in the history
Since we're now using mimalloc as our allocator, we can't free memory we
didn't allocate.
  • Loading branch information
MasterDuke17 committed Jan 4, 2022
1 parent ec909f8 commit ecb0297
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/io/fileops.c
@@ -1,5 +1,6 @@
#include "moar.h"
#include "platform/io.h"
#include "uv-common.h"

#ifndef _WIN32
#include <sys/types.h>
Expand Down Expand Up @@ -423,7 +424,7 @@ MVMString * MVM_file_readlink(MVMThreadContext *tc, MVMString *path) {

MVM_free(path_s);
result = MVM_string_utf8_c8_decode(tc, tc->instance->VMString, req.ptr, strlen(req.ptr));
MVM_free(req.ptr);
uv__free(req.ptr);

return result;
}

0 comments on commit ecb0297

Please sign in to comment.