Bug 7681

Summary: memory leak in the plug-in tests
Product: WebKit Reporter: Darin Adler <darin>
Component: Plug-insAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal CC: ap
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
patch with detailed change log sullivan: review+

Description Darin Adler 2006-03-09 07:28:09 PST
I noticed that the new plug-in tests are exhibiting leaks. The bug is in the test plug-in. I have a fix.
Comment 1 Darin Adler 2006-03-09 07:40:49 PST
Created attachment 6958 [details]
patch with detailed change log
Comment 2 Alexey Proskuryakov 2006-03-09 08:33:52 PST
> Changed code to put the strings in malloc buffers instead of relying on GCC's extension 
> that allows variable-sized arrays on the stack.

Didn't this use a standard C99 feature (although gcc variable-sized arrays aren't exactly the same as C99 ones)?
Comment 3 John Sullivan 2006-03-09 09:11:06 PST
Comment on attachment 6958 [details]
patch with detailed change log

Nice clean-up, r=me.
Comment 4 Darin Adler 2006-03-10 11:24:34 PST
(In reply to comment #2)
> Didn't this use a standard C99 feature (although gcc variable-sized arrays
> aren't exactly the same as C99 ones)?

There are good reasons to not use this in general, even though it's present in C99.

For one thing, we don't have a C99-compliant compiler on all the paltforms we target. For another, using a variable amount of stack can cause problems on OS X. Because of that, we generally don't use this technique in any production code. A test tool doesn't quite qualify as production code, of course.