Closed Bug 13296 Opened 25 years ago Closed 25 years ago

MLK: nsFormFrame::ProcessAsURLEncoded()

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: bruce, Assigned: pollmann)

Details

If this goes into the else part of if (isPost), then it won't nsCRT::free(spec).

[W] MLK: Memory leak of 87 bytes from 1 block allocated in PL_strdup
        Distribution of leaked blocks
                87 bytes from 1 block of 87 bytes (0x097ade78) allocation number
185640
        Allocation location
            malloc         [dbgheap.c:129]
            PL_strdup      [strdup.c:30]
            nsCRT::strdup(char const*) [nsCRT.h:151]
            nsStdURL::DupString(char * *,char *) [nsStdURL.cpp:673]
            nsStdURL::GetSpec(char * *) [nsStdURL.h:93]
            nsFormFrame::ProcessAsURLEncoded(int,nsString&,nsIFormControlFrame
*) [nsFormFrame.cpp:764]
            nsFormFrame::OnSubmit(nsIPresContext *,nsIFrame *)
[nsFormFrame.cpp:462]
            nsNativeTextControlFrame::EnterPressed(nsIPresContext&)
[nsNativeTextControlFrame.cpp:91]
            nsFormControlFrame::HandleEvent(nsIPresContext&,nsGUIEvent
*,nsEventStatus&) [nsFormControlFrame.cpp:431]
            nsNativeFormControlFrame::HandleEvent(nsIPresContext&,nsGUIEvent
*,nsEventStatus&) [nsNativeFormControlFrame.cpp:324]
            PresShell::HandleEvent(nsIView *,nsGUIEvent *,nsEventStatus&)
[nsPresShell.cpp:2000]
            nsView::HandleEvent(nsGUIEvent *,UINT,nsEventStatus&,int&)
[nsView.cpp:834]
            nsView::HandleEvent(nsGUIEvent *,UINT,nsEventStatus&,int&)
[nsView.cpp:818]
            nsViewManager::DispatchEvent(nsGUIEvent *,nsEventStatus&)
[nsViewManager.cpp:1610]
            HandleEvent    [nsView.cpp:66]
[W] MLK: Memory leak of 5 bytes from 1 block
Assignee: karnaze → warren
Warren, if you didn't introduce this, please reassign the bug to pollmann.
Assignee: warren → pollmann
I see the corresponding nsCRT::free at line 784 of nsFormFrame.cpp, so I either
that isn't it, or someone else already fixed this. Passing it on to Eric to
look at.
yes, the nsCRT::free() is inside of the if(isPost) part ... it has an 'else'
component (lines 792-794) ... just need to free it in there.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Um, okay...  I put in the free, conditionals on spec being non-null.

This is a code level fix and is not verifiable by running the program.  To
verift the fix, go here:
http://cvs-mirror.mozilla.org/webtools/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=mozilla/layout/html/forms/src&command=DIFF_FRAMESET&file=nsFormFrame.cpp&rev1=3.62&rev2=3.63&root=/cvsroot

Assuming bonsai has picked up this checkin, you'll notice that a "if (spec) {
nsCRT::free(spec) }" has been added.  This means the bug is fixed.
Status: RESOLVED → VERIFIED
I see the if (spec) {..} at the URL provided, thanks very much. Marking
verified.
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.