bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #63315] Test failures with 4.4 on OpenBSD


From: Paul D. Smith
Subject: [bug #63315] Test failures with 4.4 on OpenBSD
Date: Sat, 5 Nov 2022 12:59:39 -0400 (EDT)

Follow-up Comment #3, bug #63315 (project make):

Thank you for the assist Brad; I have found the problem and will fix it in the
next release.

FYI:


diff --git a/src/function.c b/src/function.c
index f0ef3434..893e583d 100644
--- a/src/function.c
+++ b/src/function.c
@@ -2801,7 +2801,7 @@ define_new_function (const floc *flocp, const char
*name,
          _("Invalid maximum argument count (%u) for function %s"), max,
name);

   ent = xmalloc (sizeof (struct function_table_entry));
-  ent->name = name;
+  ent->name = xstrdup (name);
   ent->len = (unsigned char) len;
   ent->minimum_args = (unsigned char) min;
   ent->maximum_args = (unsigned char) max;
@@ -2812,7 +2812,11 @@ define_new_function (const floc *flocp, const char
*name,
   ent->fptr.alloc_func_ptr = func;

   ent = hash_insert (&function_table, ent);
-  free (ent);
+  if (ent)
+    {
+      free ((void*)ent->name);
+      free (ent);
+    }
 }

 void



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63315>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]