Just pass potentially NULL pointers to free() in the error path in load_debug_frame(). Saved 40 bytes of code in libunwind.so on ARM -O2 thumb build at the expense of slightly slower execution. --- src/dwarf/Gfind_proc_info-lsb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/dwarf/Gfind_proc_info-lsb.c b/src/dwarf/Gfind_proc_info-lsb.c index de9ce1c..5305a5a 100644 --- a/src/dwarf/Gfind_proc_info-lsb.c +++ b/src/dwarf/Gfind_proc_info-lsb.c @@ -226,9 +226,9 @@ load_debug_frame (const char *file, char **buf, size_t *bufsize, int is_local) /* An error reading image file. Release resources and return error code */ file_error: - if (stringtab) free(stringtab); - if (sec_hdrs) free(sec_hdrs); - if (linkbuf) free(linkbuf); + free(stringtab); + free(sec_hdrs); + free(linkbuf); fclose(f); return 1; -- 1.7.9.5 _______________________________________________ Libunwind-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/libunwind-devel
