klange / toaruos

A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
https://toaruos.org/
University of Illinois/NCSA Open Source License
6.03k stars 475 forks source link

Memory leak in readelf #245

Closed liyansong2018 closed 1 year ago

liyansong2018 commented 2 years ago

Hi

stringtable variable appears to be missing in readelf.

git diff
diff --git a/apps/readelf.c b/apps/readelf.c
index ce25d5e1..7ccb8082 100644
--- a/apps/readelf.c
+++ b/apps/readelf.c
@@ -803,6 +803,7 @@ int main(int argc, char * argv[]) {

                        }
                }
+               free(stringTable);
        }

        return out;