by simias · 8y ago · 0 comments
You just replace this:
void f(int n)
{
float *x = malloc(n * sizeof*x);
// ...
free(x);
}
with this: void f(int n)
{
float x[n];
// ...
}
edit: and you can exit your function anywhere without leaking.I just need to call your example function with the right n to corrupt the stack.