From: Nick Clifton Date: Fri, 31 Jul 2026 08:06:09 +0000 (+0100) Subject: Ensure that sframe_xlate_ctx_cleanup() doe snot leave any dangling pointers X-Git-Tag: gdb-18-branchpoint~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa11363bc9ad;p=thirdparty%2Fbinutils-gdb.git Ensure that sframe_xlate_ctx_cleanup() doe snot leave any dangling pointers --- diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index b5c8f649bea..7b8c2f2f20e 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -426,7 +426,7 @@ get_fre_dataword_count (const struct sframe_row_entry *sframe_fre, bool flex_p) static unsigned int sframe_get_fre_dataword_size (const struct sframe_row_entry *sframe_fre, - bool flex_p) + bool flex_p) { unsigned int max_dataword_size = 0; unsigned int cfa_offset_size = 0; @@ -1094,6 +1094,10 @@ static void sframe_xlate_ctx_cleanup (struct sframe_xlate_ctx *xlate_ctx) { sframe_row_entry_free (xlate_ctx->first_fre); + xlate_ctx->first_fre = NULL; + xlate_ctx->last_fre = NULL; + xlate_ctx->num_xlate_fres = 0; + xlate_ctx->flex_p = false; XDELETE (xlate_ctx->remember_fre); xlate_ctx->remember_fre = NULL; XDELETE (xlate_ctx->cur_fre);