Fix memory leaks

This commit is contained in:
Rodrigo Arias 2021-11-18 14:53:15 +01:00
parent 8c58a7a6ab
commit 3e35f3d88b
4 changed files with 14 additions and 0 deletions

4
emu.c
View File

@ -1108,6 +1108,10 @@ emu_destroy(struct ovni_emu *emu)
close_pcfs(emu);
destroy_metadata(emu);
ovni_free_streams(&emu->trace);
ovni_free_trace(&emu->trace);
free(emu->global_cpu);
free(emu->global_thread);
}
int

View File

@ -90,5 +90,7 @@ int main(void)
ovni_flush();
ovni_proc_fini();
free(payload_buf);
return 0;
}

View File

@ -445,6 +445,12 @@ ovni_free_streams(struct ovni_trace *trace)
free(trace->stream);
}
void
ovni_free_trace(struct ovni_trace *trace)
{
free(trace->loom);
}
int
ovni_load_next_event(struct ovni_stream *stream)
{

View File

@ -29,4 +29,6 @@ int ovni_load_streams(struct ovni_trace *trace);
void ovni_free_streams(struct ovni_trace *trace);
void ovni_free_trace(struct ovni_trace *trace);
#endif /* OVNI_TRACE_H */