We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e8b679 commit 476fd47Copy full SHA for 476fd47
lib/pkg_editor/src/pkg_editor.c
@@ -1107,6 +1107,16 @@ int acl_pkg_close_file(acl_pkg_file *pkg) {
1107
// allocated buffers used to store file contents may be freed.
1108
free_buffers(pkg);
1109
1110
+ // If the file is not read-only, the string table data buffer
1111
+ // has been dynamically allocated in add_required_parts() when
1112
+ // creating a new file, or make_string_table_extensible() when
1113
+ // appending to an existing file, and may be freed now.
1114
+ if (pkg->writable) {
1115
+ Elf_Data *data = get_name_data_ptr(pkg);
1116
+ assert(data);
1117
+ free(data->d_buf);
1118
+ }
1119
+
1120
// Should be albe to call elf_end even if elf_update failed
1121
while (elf_end(pkg->elf)) {
1122
if (pkg->show_info)
0 commit comments