For some reason there was a malloc in os_read
This commit is contained in:
3
build.sh
3
build.sh
@@ -4,6 +4,7 @@ if [ ! -d build ]; then
|
||||
mkdir build
|
||||
fi
|
||||
cd build
|
||||
clang $(realpath ../src/testing/testing_main.c) -o testing_main -I../src -g -Wall -Wextra -Werror -fdiagnostics-absolute-paths -Wno-single-bit-bitfield-constant-conversion -Wno-unsequenced -Wno-missing-field-initializers -Wno-missing-braces -ldl -lm -lbacktrace
|
||||
clang $(realpath ../src/testing/testing_main.c) -o testing_main -I../src -g -Wall -Wextra -Werror -fdiagnostics-absolute-paths -Wno-single-bit-bitfield-constant-conversion -Wno-unsequenced -Wno-missing-field-initializers -Wno-missing-braces -fsanitize=address,undefined -fno-omit-frame-pointer -ldl -lm -lbacktrace
|
||||
|
||||
./testing_main
|
||||
cd ..
|
||||
|
||||
@@ -550,7 +550,7 @@ fn s8_t os_read(ma_arena_t *arena, s8_t path) {
|
||||
fseek(fd, 0, SEEK_END);
|
||||
long size = ftell(fd);
|
||||
fseek(fd, 0, SEEK_SET);
|
||||
char *string = malloc(size + 1);
|
||||
char *string = ma_push_array(arena, char, size + 1);
|
||||
fread(string, size, 1, fd);
|
||||
fclose(fd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user