]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas: Fix memory leaks in gen-sframe.c
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 11 Apr 2024 11:26:34 +0000 (04:26 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 12 Apr 2024 10:55:33 +0000 (03:55 -0700)
* gen-sframe.c (sframe_xlate_ctx_cleanup): Call XDELETE on
xlate_ctx->cur_fre.
(create_sframe_all): Call XDELETE on xlate_ctx after use.

gas/gen-sframe.c

index 75781fc8ccbd162c6497a3d16e83299ca395171e..25b858e432bca2efa95741452f8393f3a12d8abc 100644 (file)
@@ -847,6 +847,8 @@ sframe_xlate_ctx_cleanup (struct sframe_xlate_ctx *xlate_ctx)
        }
     }
 
+  XDELETE (xlate_ctx->cur_fre);
+
   sframe_xlate_ctx_init (xlate_ctx);
 }
 
@@ -1360,6 +1362,8 @@ create_sframe_all (void)
          sframe_fde_link (sframe_fde);
        }
     }
+
+  XDELETE (xlate_ctx);
 }
 
 void