Skip to content

Commit d2ff13e

Browse files
committed
Resolve memory leak from load from file.
1 parent 70bff29 commit d2ff13e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/metacall/source/metacall.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ int metacall_load_from_file(const char *tag, const char *paths[], size_t size, v
252252
strncpy(path_impl[iterator], paths[iterator], LOADER_NAMING_PATH_SIZE);
253253
}
254254

255-
return loader_load_from_file(tag, (const loader_naming_path *)path_impl, size, handle);
255+
int result = loader_load_from_file(tag, (const loader_naming_path *)path_impl, size, handle);
256+
257+
free(path_impl);
258+
259+
return result;
256260
}
257261

258262
int metacall_load_from_memory(const char *tag, const char *buffer, size_t size, void **handle)

0 commit comments

Comments
 (0)