Skip to content

Commit b13d3c4

Browse files
a nicer fix
1 parent 869a216 commit b13d3c4

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/module_loader.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,6 @@ bool module_load_from_memory(const void *file, size_t len, module *out) {
482482
return false;
483483
}
484484

485-
memset(out, 0, sizeof(*out));
486-
487485
if (!parse_elf_rel_headers((const uint8_t *) file, len, &eh, &sh, &shnum, &shstr)) {
488486
dprintf("module_load_from_memory: header parse failed\n");
489487
return false;
@@ -581,7 +579,6 @@ bool load_module(const char* name) {
581579
dprintf("Out of memory\n");
582580
return false;
583581
}
584-
const char* saved_name = m.name;
585582
if (hashmap_get(modules, &m)) {
586583
dprintf("Module %s already loaded\n", name);
587584
kfree_null(&m.name);
@@ -611,8 +608,6 @@ bool load_module(const char* name) {
611608
kfree_null(&m.name);
612609
return false;
613610
}
614-
m.name = saved_name;
615-
m.raw_bits = module_content;
616611
hashmap_set(modules, &m);
617612
module* stored = hashmap_get(modules, &(module){ .name = name });
618613
modreg_register(stored);

0 commit comments

Comments
 (0)