mem: free the allocated memory

Message ID 20240619052843.22086-1-zhangxianting@uniontech.com
State New
Headers
Series mem: free the allocated memory |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed

Commit Message

zhangxianting June 19, 2024, 5:28 a.m. UTC
  ---
 gas/config/tc-bfin.c                     | 4 ++++
 gprofng/examples/mxv-pthreads/src/main.c | 1 +
 2 files changed, 5 insertions(+)
  

Patch

diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c
index cbf09037e48..3a941c72949 100644
--- a/gas/config/tc-bfin.c
+++ b/gas/config/tc-bfin.c
@@ -1884,6 +1884,8 @@  bfin_gen_loop (Expr_Node *exp, REG_T reg, int rop, REG_T preg)
   if (!S_IS_LOCAL (sym) || (S_IS_LOCAL (sym) && !symbol_used_p (sym)))
     symbol_remove (sym, &symbol_rootP, &symbol_lastP);
 
+  free(lbeginsym);
+  free(lendsym);
   return bfin_gen_loopsetup (lbegin, reg, rop, lend, preg);
 }
 
@@ -1919,6 +1921,8 @@  bfin_loop_beginend (Expr_Node *exp, int begin)
      Adjust label address.  */
   if (!begin)
     *symbol_X_add_number (linelabel) -= last_insn_size;
+
+  free(label_name);
 }
 
 bool
diff --git a/gprofng/examples/mxv-pthreads/src/main.c b/gprofng/examples/mxv-pthreads/src/main.c
index 625c60484d1..049c570a4f9 100644
--- a/gprofng/examples/mxv-pthreads/src/main.c
+++ b/gprofng/examples/mxv-pthreads/src/main.c
@@ -370,5 +370,6 @@  int64_t check_results (int64_t m, int64_t n, double *c, double *ref)
       printf ("  %c c[%ld] = %f ref[%ld] = %f\n",marker[i],i,c[i],i,ref[i]);
   }
 
+  free(marker);
   return (errors);
 }