+2024-10-08 Bruno Haible <bruno@clisp.org>
+
+ csharpcomp: Fix memory management bug (regression yesterday).
+ * lib/csharpcomp.c (compile_csharp_using_sscli): Allocate the source
+ options with malloc() always, not sometimes with malloca() and sometimes
+ with malloc().
+
2024-10-07 Bruno Haible <bruno@clisp.org>
csharpcomp: Improve Cygwin support.
we need to use cygpath_w. */
malloced =
(char **)
- xmalloca ((1 + libdirs_count + sources_count) * sizeof (char *));
+ xmalloca ((1 + libdirs_count + sources_count * 2) * sizeof (char *));
mallocedp = malloced;
argc =
10) == 0)
{
char *option =
- (char *) xmalloca (10 + strlen (source_file_converted) + 1);
-
+ (char *) xmalloc (10 + strlen (source_file_converted) + 1);
memcpy (option, "-resource:", 10);
strcpy (option + 10, source_file_converted);
+ *mallocedp++ = option;
*argp++ = option;
}
else
for (i = 2; i < 3 + libdirs_count + libraries_count; i++)
freea ((char *) argv[i]);
- for (i = 0; i < sources_count; i++)
- if (argv[argc - sources_count + i] != sources[i])
- freea ((char *) argv[argc - sources_count + i]);
while (mallocedp > malloced)
free (*--mallocedp);
freea (argv);