Re: [patch] clean up potential memory leak in thread.c

Daniel Jacobowitz
2005-10-03T14:40:26Z

On Mon, Oct 03, 2005 at 10:30:12AM -0400, Kris Warkentin wrote:
> We're throwing named thread support into the kernel so I'm keeping an
> arbitrary length string in there. Would never be a huge memory leak but
> I'm fussy that way.

You don't actually need this to add an arbitrary lenth string; the
target gets to malloc this, you can use a trailing char[1] or simply
malloc sizeof(struct) + strlen (char) + 1 and point the char* right
after the struct.

If it's clearer to do it this way, though, we can go with your patch.
If you'd rather do that let me know; IIRC there were some formatting
glitches.

--
Daniel Jacobowitz
CodeSourcery, LLC